View Full Version : LOOK Script
beldannon5
05-10-2015, 08:36 PM
I am looking for a script that does look behind under etc when you go in a room, like .look Cause I never remember or take the time. Is there one or can someone write up an easy one.
JackWhisper
05-10-2015, 08:37 PM
So....
You saw people finding gems....
And you want a script that automates it so you can find a gem.
:lol: :lol:
beldannon5
05-10-2015, 08:44 PM
yes, yes i do. well not automatic but a script that helps
Fallen
05-10-2015, 08:55 PM
It would literally just be
Put look in %1
Put look on %1
Put look under %1
Put look behind %1
Command for use would be .Look desk/bench/etc if you named the script look.
beldannon5
05-10-2015, 09:02 PM
wow that is easy thank you.
Tgo01
05-10-2015, 09:36 PM
You could do:
GameObj.loot.each{ |item|
put "look under #{item}"
put "look behind #{item}"
}
You can keep adding things using the same template as above for things like "look in" etc etc. This would automatically do every item in the room that shows up under the "you also see" line.
You can do the same for items that are part of the room description but I'm on my phone and I forget the exact wording but I think it's:
GameObj.room_desc
Or something like that. I'm sure someone can correct me.
Tgo01
05-15-2015, 05:41 PM
Wrote up a simple little lich script to do this:
do_it = [ "on", "in", "under", "behind" ]
silence_me
squelch_info = proc{
action = proc { |server_string|
if server_string =~ /There is nothing on there\.|There is nothing in there\.|There is nothing under there\.|There is nothing behind there\.|Looking under the .*\, you see nothing\.|The .* is filled with a variety of garbage\. You see nothing useful or appetizing\./
DownstreamHook.remove("#{script.name}_squelch_info")
nil
else
DownstreamHook.remove("#{script.name}_squelch_info")
server_string
end
}
DownstreamHook.add("#{script.name}_squelch_info", action)
}
current_room = nil
do_the_stuff = proc{
respond "##############"
respond "Scanning room."
respond "##############"
GameObj.loot.each{ |item|
do_it.each { |do_it|
squelch_info.call
fput "look #{do_it} ##{item.id}" if (item.name !~ /disk|coffin/)
}
}
GameObj.room_desc.each{ |item|
do_it.each { |do_it|
squelch_info.call
fput "look #{do_it} ##{item.id}"
}
}
respond "##################"
respond "Finished scanning."
respond "##################"
current_room = Room.current.id
}
before_dying { DownstreamHook.remove("#{script.name}_squelch_info") }
if script.vars[1] == "auto"
loop{
if current_room != Room.current.id
do_the_stuff.call
end
sleep 0.1
}
else
do_the_stuff.call
end
You can add anything to to "do_it" variable up there but I'm pretty sure you only need to look in, on, under and behind items. Also you can add anything to the if (item.name !~ /disk|coffin/) so it won't bother checking for items that match items with that name, no point in looking in someone's disk for example.
Script won't spam you with a bunch of "look in", "look under" blah blah blah lines, it also won't show you the line if you get the standard "There is nothing on there." line.
If you start the script with no command line arguments it will look through every loot item as well as any items that are part of the room description in the current room.
For example:
A pair of guards lean back against the archway of the bright blue building housing the Icemule Trace branch of the First Elanith Bank. One guard seems to be dozing on his stool, while the other keeps a close and wary eye on the traffic flowing past. You also see a sable mountain puma, a spindly fel raffle table carved with twisting vines and roses with some stuff on it and an old beer barrel.
Obvious paths: east, south, west
##############
Scanning room.
##############
On the raffle table you see a warning sign, a raffle ticket barrel and some raffle tickets.
>
Behind the beer barrel you see a sloppy red tunic.
>
##################
Finished scanning.
##################
Even though there is an archway, a guard, a raffle table and an old beer barrel in the room there is only something on the raffle table and behind the beer barrel which is why those are the only lines it showed. I also have it squelch the line of looking in a trash container and seeing nothing appetizing.
Here is an example where the script found nothing at all so you get zero spam.
A few small shops front Honeybeer Road here, selling odds and ends. One shop has a windowbox filled with colorful pinwheels that spin wildly whenever someone passes nearby. Another shop window is filled with a display of beer mugs. A freshly hung arrow points towards a doorway.
Obvious paths: east, west
>##############
Scanning room.
##############
>
##################
Finished scanning.
##################
If you start the script with the command line variable of "auto" then the script will automatically look through items every time you enter a new room. Keep in mind if you move through rooms before the script is finished scanning the room then it won't work properly at all, this for sure won't work properly if you're running it with ;go2.
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.