Page 1 of 1
Is this dificult ?
Posted: 2006-08-31 02:56:46
by Knight1106
Well, i was try to do a script that when i press its hotkey its starts to heal and stop only when i press the hotkey again, but with this script below the functions aren't terminate, the script stops to heal but the funstion T still running, Why ?
Anyone knows how to do what i want ?
plz tell me
thanks
Code: Select all
sub T() #Heal
var m=uo.mana
if uo.getglobal('Healing')=='On' then
uo.setglobal('Healing','Off')
else
uo.setglobal('Healling','On')
end if
repeat
m=uo.mana
uo.cast('Heal','self')
uo.deletejournal()
while uo.mana>=m || uo.injournal('fizzles')
wait(1)
wend
until uo.getglobal('Healing')=='Off'
end sub
Posted: 2006-08-31 12:23:35
by Raisefamous
Here you go
Code: Select all
sub he()
if uo.life < uo.str then
uo.bandageself()
wait(300)
uo.usetype('0x1B76')
wait(300)
uo.msg('.drink_heal_great')
wait(300)
uo.usetype('0x0E2A')
uo.cast('Greater Heal','self')
end if
end sub
Something like your scpt but a bit better,I think
Posted: 2006-08-31 16:51:14
by Nmy
Code: Select all
##########################################
Sub test()
##########################################
If uo.getglobal('test')=='11' then
uo.setglobal('test',00)
uo.print(' !!! -= Test: off =- !!! ')
uo.exec('terminate test')
else
uo.setglobal('test',11)
uo.print(' !!! -= Test: on =- !!! ')
end if
#;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;#
;script
;script
;script
#;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;#
uo.setglobal('test',00)
uo.print(' !!! -= Test: off =- !!! ')
##########################################
end sub
##########################################
Posted: 2006-08-31 18:15:26
by Knight1106
NMY wrote:Code: Select all
##########################################
Sub test()
##########################################
If uo.getglobal('test')=='11' then
uo.setglobal('test',00)
uo.print(' !!! -= Test: off =- !!! ')
uo.exec('terminate test')
else
uo.setglobal('test',11)
uo.print(' !!! -= Test: on =- !!! ')
end if
#;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;#
;script
;script
;script
#;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;#
uo.setglobal('test',00)
uo.print(' !!! -= Test: off =- !!! ')
##########################################
end sub
##########################################
Thank you, now it is working... But, can you explain me what is wrong in my Script ? They appears to be the same o.O
thanks
Posted: 2006-08-31 18:23:28
by Nmy
if you set global OFF it doesnt means that the script must stop his actions, so you must kill it

or:
Code: Select all
sub T() #Heal
var m=uo.mana
if uo.getglobal('Healing')=='On' then
uo.setglobal('Healing','Off')
return
else
uo.setglobal('Healling','On')
end if
while uo.getglobal('Healing')<>'Off'
m=uo.mana
uo.cast('Heal','self')
uo.deletejournal()
while uo.mana>=m || uo.injournal('fizzles')
wait(1)
wend
wend
end sub
Posted: 2006-08-31 21:07:39
by Knight1106
NMY wrote:if you set global OFF it doesnt means that the script must stop his actions, so you must kill it

or:
Code: Select all
sub T() #Heal
var m=uo.mana
if uo.getglobal('Healing')=='On' then
uo.setglobal('Healing','Off')
return
else
uo.setglobal('Healling','On')
end if
while uo.getglobal('Healing')<>'Off'
m=uo.mana
uo.cast('Heal','self')
uo.deletejournal()
while uo.mana>=m || uo.injournal('fizzles')
wait(1)
wend
wend
end sub
This new way you post does not works o.O
Posted: 2006-08-31 21:19:13
by Nmy
i know... just use the terminate... gl
