Wait for spell

Ask for help

Moderators: Murderator+, Murderator

Post Reply
Knight1106
Posts: 64
Joined: 2005-09-08 18:38:12

Wait for spell

Post 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
DerMeister =)
Expert!
Posts: 1032
Joined: 2006-02-25 21:48:38

Post 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 =_(
DerMeister сейчас на нейрале!
knicholes
Posts: 9
Joined: 2004-05-16 00:08:59
Location: Utah
Contact:

Try this one

Post 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

Nmy
Expert!
Posts: 2152
Joined: 2005-09-14 15:31:58
Location: Latvia

Post 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
knicholes
Posts: 9
Joined: 2004-05-16 00:08:59
Location: Utah
Contact:

Post 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
Nmy
Expert!
Posts: 2152
Joined: 2005-09-14 15:31:58
Location: Latvia

Post 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:
Azt
Posts: 43
Joined: 2007-09-03 16:31:57

Re: Try this one

Post 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...
Last edited by Azt on 2007-11-17 18:52:49, edited 1 time in total.
Azt
Posts: 43
Joined: 2007-09-03 16:31:57

Post by Azt »

up
Post Reply