PDA

View Full Version : Sorcerer scripts



stormtov
12-29-2008, 03:22 PM
OK thought i would make a thread for putting any useful sorcery related scripts. I've just seen that Gib's pickup and phase script seems to of gone so if he could repost(or some one on his behalf) that would be good.

First off here is a script for lich to track the duration left on phased containers. Here is a quick pic to show what it looks like:
http://img136.imageshack.us/img136/8424/704monitorsm8.jpg
It currently should cut off the long description on items as shown above, only got the one item to test that with though.

Shown is just the default window size, you can adjust the height of it by opening up the script(more info on this in the script notes).


=begin
704 monitor
Will pop up a window when the script starts and write to it when ever you phase a container showing it's name and duration left.
Currently does not save anything between runs of the script. If you close the script(like when you log off) it will not remember phased containers and their durations
If you would like to change the window height open up the script(notepad will do) and change the line at the top that reads height = 55
***Bug Fixes***
30/12/08 - Fixed a bug where casting any spell at a phased item would clear it from the monitor

***Updates***
30/12/08 - Will save durations for when you log off. If you kill the script but stay logged into game the durations it will greatly effect the accuracy of the duration(it only counts down while the script is running).
30/12/08 - Added a clear command. The format is ";send 704monitor clear (all|1|2|3....)" The bit in the brackets responds to what it is clearing. All to clear the whole window or if using a number it will clear that line only(entering 2 clears the 2nd line).
30/12/08 - Detects the phase duration being ended earlier(by dropping, recasting phase or by using dispel. I don't know of any other ways) even when an item is still an another container.
29/12/08 - Will detect you ending the duration of phase early if the item is in your hand when it happens. Like if your trying to drop it

***Future updates***
Look into tracking items my ID, but looking unlikely as phasing changes the container ID. Currently if you have two items with the same name it will track them both but when ending the duration early it will remove the first ocurance of the item from the tracker no matter which one you unphase.

***Contact Me***
If there is a problem with the script or you have suggestions feel free to contact Dalzashel on psinet or lich or "ed002002" on aim/yahoo
=end
Settings.load
Settings[Char.name] = Hash.new unless Settings[Char.name].kind_of? Hash
before_dying{;puts("<closeDialog id=\"704_monitor\"\/>");Settings.save;}
height = 55 #Change the height of the window here(deafult 55, enough for 3 lines. With default font size add 11 for any extra line). If window is already open will need to be closesd before thsi change can take effect.
def save_durations()
if $time_phased.empty?
Settings[Char.name]["time"] = "empty"

else
x=0
saved_time = Array.new
loop{

saved_time[x] = Time.now - $time_phased[x]
x = x + 1
break if x > ($time_phased.length - 1)
}

Settings[Char.name]["time"] = saved_time
$container_full.compact!
Settings[Char.name]["saved_container_full"] = $container_full.compact
$container_short.compact!
Settings[Char.name]["saved_container_short"] = $container_short.compact

end

end

def load_duration()

if Settings[Char.name]["time"] == "empty"
clear_arrays()
else

x = 0
$time_phased = Array.new
loop{

$time_phased[x] = Time.now - Settings[Char.name]["time"][x]
x = x + 1
$x = x

break if x > (Settings[Char.name]["time"].length - 1)
}
$container_full = Settings[Char.name]["saved_container_full"]
$container_short = Settings[Char.name]["saved_container_short"]


end
end

def shorten()


x = 0
y = 0
$container_split = $container_full[$x].split(" ")
$container_split.compact!
$check = false
loop {

if $container_split[x]== $container_short[$x]

$check = true

x = x + 1
end

if $check == true
$container_split[x] = nil


end

x = x + 1


break if x > ($container_split.length - 1)
}


$container_full[$x] = $container_split.compact! * " "

end

def remove()
x = 0
loop {
if $container_full[x] =~ /#{$remove_item}/
$time_phased[x] = $time_phased[x] - $duration

break
else
x = x + 1
break if x > ($container_full.length - 1)
end
}
end

def clear_arrays()
$container_full = Array.new
$container_short = Array.new
$time_phased = Array.new
$x = 0
end
puts("<openDialog type='dynamic' id='704_monitor' title='Phase Duration Monitor' location='center' height='#{height}' width='300'><dialogData id='espWindowControl'><label id='lblHeader' value='' top='0' left='0' width='138'/></dialogData></openDialog>")


if Settings[Char.name]["first_time?"] != "no"
echo "This script should track your durations fine unless you kill the script and stayed logged into game. It will save the durations though so if you log out it will remember the durations. Just make sure to add the script to your favourates so it runs on startup"
respond "If for what ever reason the timing is off you can remove them from the window manually using ';send 704monitor clear (all/1/2/3...)' Entering all clears all the window entering a number clears just the line only(ie entering 2 will clear just the second line)"
respond "This message will only display once so hope you were paying attention"
clear_arrays()
else
load_duration()
end
Settings[Char.name]["first_time?"] = "no"
Settings.save
$duration = 600 + (Spells.sorcerer * 6)



phase_monitor = Thread.new {
loop {
line = get

if line =~ /You gesture at a shifting (.+)\./

$remove_item = $1
line = get
if line =~ /Your spell has no effect/
$remove_item = nil
else
remove()
end
elsif line =~ /You gesture at (a|an) (.+)\./

$container_full[$x] = $2


elsif line =~ /The (.+) becomes momentarily insubstantial and appears lighter\.|The (.+) becomes somewhat insubstantial and appears lighter\./


if $1.empty? == false
$container_short[$x] = $1
else
$container_short[$x] = $2
end
$time_phased[$x] = Time.now



shorten()
$x = $x + 1
elsif line =~ /Your (.+) feels somewhat heavier./
#ill get there
elsif line =~ /(Your|The) (.+) flickers in and out of existence for a moment but then stabilizes. It seems heavier./

$remove_item = $2
remove()
elsif line =~ /^704monitor clear (\w+)$/
clear = $1
if clear == "all"
x = 0
loop {
$time_phased[x] = $time_phased[x] - $duration
x = x + 1
break if x > ($time_phased.length - 1)
}
else
$time_phased[clear.to_i-1] = $time_phased[clear.to_i-1] - $duration
end
end


z = 0
loop {

z=z+1
break if z > ($container_short.length - 1)
}

}
}

duration_thread = Thread.new {

loop {

if $container_short.length > 0
time_now = Time.now
z=0

loop {

time_elapsed = time_now - $time_phased[z]

$time_left = $duration - time_elapsed
mins = $time_left/60
secs = $time_left%60






if $time_left > 0

puts("<dialogData id='704_monitor'><label id='duration#{z}' value='#{$container_full[z]}: #{mins.to_i}M #{secs.to_i}' top='#{z*15}' left='0' height='20' align='n' width='300' tooltip='Meh'/></dialogData>")
z=z+1
else

a=z
$container_short[a] = nil
$container_short.compact!
$container_full[a] = nil
$container_full.compact!
$time_phased[a] = nil
$time_phased.compact!
loop {
puts("<dialogData id='704_monitor'><label id='duration#{a}' value='' top='0' left='0' height='20' align='n' width='300' tooltip='Meh'/></dialogData>")
a = a + 1


break if a > ($container_short.length)
}

$x = $x - 1
#z=z+1

end
#sleep 1




break if z > ($container_short.length - 1)

}

else

sleep 1
end
sleep 1

}
}

save_thread = Thread.new {

loop {

save_durations()
Settings.save

sleep 1
}
}


phase_monitor.join
duration_thread.join
save_thread.join

If you find any bugs please feel free to point them out here or message Dalzashel in game on psinet/lich

stormtov
12-29-2008, 03:30 PM
This post contains spoilers for the vaalor guild entrance puzle

This script will get you into the vaalor guild. Start it from the shadowy corner.








Scroll down for script, hidden for those who don't like spoilers.


























put prep 707
put cast
put tell eye go out
put tell eye go s
put tell eye go doo
put tell eye go nw
put tell eye go nw
put tell eye go e
put tell eye go water
put tell eye go grate
put tell eye go se
put tell eye go se
put tell eye go open
put tell eye go stair
put tell eye read chal
match cerikar'fyn erikar'fyn
match cag'loenar ag'loenar
match cgrik'tyr grik'tyr
match codeir'cos odeir'cos
match cvakra vakra
match cbeiron'fyn beiron'fyn
match cikar'fyn ikar'fyn
match cquiss'fyn quiss'fyn
match cwy'zio wy'zio
match clorae'tyr lorae'tyr
match cshien'tyr shien'tyr
matchwait
cag'loenar:
put draw ag'loenar rune on chal
goto next
cgrik'tyr:
put draw grik'tyr rune on chal
goto next
codeir'cos:
put draw odeir'cos rune on chal
goto next
cvakra:
put draw vakra rune on chal
goto next
cbeiron'fyn:
put draw beiron'fyn rune on chal
goto next
cikar'fyn:
put draw ikar'fyn rune on chal
goto next
cquiss'fyn:
put draw quiss'fyn rune on chal
goto next
cwy'zio:
put draw wy'zio rune on chal
goto next
cerikar'fyn:
put draw erikar'fyn rune on chal
goto next
clorae'tyr:
put draw lorae'tyr rune on chal
goto next
cshien'tyr:
put draw shien'tyr rune on chal
goto next
next:
waitfor As you sketch
put tell eye read bas
match berikar'fyn erikar'fyn
match bag'loenar ag'loenar
match bgrik'tyr grik'tyr
match bodeir'cos odeir'cos
match bvakra vakra
match bbeiron'fyn beiron'fyn
match bikar'fyn ikar'fyn
match bquiss'fyn quiss'fyn
match bwy'zio wy'zio
match blorae'tyr lorae'tyr
match bshien'tyr shien'tyr
matchwait
bag'loenar:
put draw ag'loenar rune on bas
goto end
bgrik'tyr:
put draw grik'tyr rune on bas
goto end
bodeir'cos:
put draw odeir'cos rune on bas
goto end
bvakra:
put draw vakra rune on bas
goto end
bbeiron'fyn:
put draw beiron'fyn rune on bas
goto end
bikar'fyn:
put draw ikar'fyn rune on bas
goto end
bquiss'fyn:
put draw quiss'fyn rune on bas
goto end
bwy'zio:
put draw wy'zio rune on bas
goto end
berikar'fyn:
put draw erikar'fyn rune on bas
goto end
blorae'tyr:
put draw lorae'tyr rune on bas
goto end
bshien'tyr:
put draw shien'tyr rune on bas
goto end


end:
put tell eye ret

stormtov
12-29-2008, 11:35 PM
Updated the 704 monitor. Now detects you ending phase early when the item is in hand(like for instance if you try to drop it).

radamanthys
12-30-2008, 03:26 AM
sweet thread. I'm gonna look for this once I open rada up again.

stormtov
12-30-2008, 02:31 PM
The, hopefully, final update to the 704monitor script has just been added. Can read the notes at the top for full info but basically it should now remember the duration even when you log off, just make sure to have the script in favourites so it runs on startup. The script can only count down while the script is running.