Page 1 of 1

cast on account and char

Posted: 2008-03-05 20:03:40
by iRuLez
all know with in some shard is possible to create with 1 account, 1/2/3/4/5 char.
well i have need with a script with if one of five char is online then cast spell on him.

i have create this, but is more slow if my friend is connect with the last char

Code: Select all

sub qwe()
	uo.waittargetobject("player1")
	uo.cast(namespell)
	wait(200)
	uo.waittargetobject("player2")
	uo.cast(namespell)
	wait(200)
	uo.waittargetobject("player3")
	uo.cast(namespell)
endsub
where player1/2/3 have been add with ",addobject player1/2/3" and save it in tab "Objects"

Do u know another method for this?

Posted: 2008-03-05 21:16:09
by iRuLez
don't work

Code: Select all

sub reft()
	var i
	dim pg[2]
		pg[0] = "0x0005f80f"
		pg[1] = "0x0005f80d"
	
	uo.cast("Magic Reflection","pg[i]")
endsub
and display inject say: "invalid serial index"

Posted: 2008-03-05 21:34:49
by Grin

Code: Select all

sub reft() 
   var i 
   dim pg[2] 
      pg[0] = "0x0005f80f" 
      pg[1] = "0x0005f80d" 
    
   for i = 0 to 1
   	uo.print(str(uo.getDistance(pg[i])))# need to check what getDistance return for offline char
   	if uo.getDistance(pg[i]) then 
   		uo.cast("Magic Reflection",pg[i])
   		return
   	end if
   next
endsub

Posted: 2008-03-05 22:21:15
by iRuLez
grin, i love u :D
tnx

Posted: 2008-03-05 22:23:54
by Grin
em... no thanks...