Page 1 of 1

Wait for spell

Posted: 2006-07-21 22:07:25
by Knight1106
Is there any comand that shows if the character is casting or not a spell ?
Like uo.poisoned() shows if the character is poisoned or not...
I was needing it in this script, because with "wait" there is a chance to frizzle the spell because of the lag...

Code: Select all

sub F3() #Disturb
loop:
 uo.cast('Weaken','laststatus')
 while Uo.casting()
 wait(10)
 wend
goto loop
end sub
if anyone understood me, plz help...

thanks

Posted: 2006-07-21 22:29:28
by DerMeister =)
You may use something like this:

Code: Select all

sub F3() #Disturb 
loop: 
 uo.cast('Weaken','laststatus') 
 while uo.waiting() 
 wait(100) 
 wend 
goto loop 
end sub
PS: There is no any special command that shows if the character is casting a spell =_(

Try this one

Posted: 2006-08-21 00:46:34
by knicholes
This code is called right after you cast a spell. It will wait until you lose mana or if it fizzles.

Code: Select all

##### Waits until you lose mana #################
sub lostmana()
var current
current = UO.MANA
while UO.MANA >= current
if UO.InJournal("fizzle") then
return
endif
wait(100)
wend
end sub


Posted: 2006-08-21 01:03:55
by Nmy

Code: Select all

sub F3() #Disturb
VAR m
 m=uo.mana
 uo.cast('Weaken','laststatus')
 repeat
 wait(5)	
 until uo.mana<m
end sub
but there is no sense in that script

Posted: 2006-08-21 02:25:49
by knicholes
To cast the spell over and over again, the best way to code this would be:
NMY wrote:

Code: Select all

sub F3() #Disturb
VAR m
 m=uo.mana
 uo.cast('Weaken','laststatus')
 repeat
 wait(5)	
 until uo.mana<m
end sub
but there is no sense in that script

Code: Select all

sub F3() #Disturb 
loop: 
 uo.cast('Weaken','laststatus') 
 lostmana()
goto loop 
end sub

Posted: 2006-08-21 11:43:49
by Nmy
you mean:

Code: Select all

Sub LIGHTNING()
	If uo.getglobal('Lightning')=='On' then
	uo.setglobal('Lightning',0)
	uo.print(' !!! -= Lightning terminated =- !!! ')
	uo.exec('terminate Lightning')
	else
	uo.setglobal('Lightning','On')
	uo.print(' !!! -= Lightning: on =- !!! ')
	VAR m
	repeat
	m=uo.mana
	#var t=uo.timer()
	#uo.textopen()
	uo.cast('Lightning','last')
	repeat
	wait(5)
	IF uo.mana==uo.int then
	m=uo.int
	end if
	until uo.mana<m
	#t=uo.timer()-t
	#uo.textprint(t)
	until uo.mana < 11
	uo.setglobal('Lightning',0)
	uo.print(' !!! -= Lightning: OFF =- !!! ')
end sub 
man... use search :roll:

Re: Try this one

Posted: 2007-11-17 04:12:16
by Azt
knicholes wrote:This code is called right after you cast a spell. It will wait until you lose mana or if it fizzles.

Code: Select all

##### Waits until you lose mana #################
sub lostmana()
var current
current = UO.MANA
while UO.MANA >= current
if UO.InJournal("fizzle") then
return
endif
wait(100)
wend
end sub

this script in stopped when someone cast a spell on you....

when i cast a spell anche someone disturbs my concentration, the script stops...

Posted: 2007-11-17 14:39:04
by Azt
up