[english] problems finding people (script crashing)

Ask for help

Moderators: Murderator+, Murderator

Post Reply
Yavimaya
Posts: 5
Joined: 2006-11-02 08:17:56

[english] problems finding people (script crashing)

Post by Yavimaya »

sorry about the huge code, i am having trouble getting an auto bless script going, my main problem is getting it to find the people. i used a lumberjacking script that was given to me for the actual blessing.
I had it about right (male and female parts work fine seperataly)
but since i have added the check to see if they are male or female... it just crashes.... parse error at line 14.... but line 14 is the line to cast mass dispel.
I cannot see where the error is, but it wont run for me.
If anyone could fix up my errors, or better yet, tell me how to add a proper check for "players", preferably not needing to distinguish between male and female (all i can see is the types, can you use a "wildcard" number at the end? e.g 0x019* ?)

Thanks for any help.

Code: Select all

sub Blesser()
UO.set("finddistance","3")


start:
repeat
wait(500)
until UO.injournal("dispel") or UO.injournal("Dispel") or UO.injournal("DISPEL") or UO.injournal("bless") or UO.injournal("Bless") or UO.injournal("BLESS")


if UO.injournal("dispel") or UO.injournal("Dispel") or UO.injournal("DISPEL") then
UO.Say('Watch out! Here comes a mass dispel!")
wait(3000)
UO.Exec ("cast 'Mass Dispel' self")
UO.DeleteJournal()
Wait(4000)
goto start
else

retry:
UO.FindType( '0x0190', '-1', '1' )

If UO.Getserial('finditem') == uo.Getserial('self') Then 
         UO.Ignore('finditem')
          goto retry
End If 

If UO.FindCount() > 0 Then
     male()
   Else 
 	female()
endif
endif
endif
end sub



# # # # # # # # # # # # # # # # # # # # # # # # # # #
sub male() 
UO.say("Males get blessed now")
   var i = 0 
   var time = 0 
   var count 
    
   UO.FindType( '0x0190', '-1', '1' )
   count = UO.FindCount() 
   UO.Print("Found " + str(count) + " trees on screen.") 
    
   dim people[val(str(count))] 

   Repeat 
      UO.FindType( '0x0190', '-1', '1' )
      people[i] = UO.GetSerial('finditem') 
        
      #Check if people found are in range 
      If UO.GetDistance(people[i])>3 Then 
         count = count - 1 
      Else 
         i = i + 1 
      End If 
        
      UO.Ignore('finditem') 
   Until i == count 
   UO.IgnoreReset() 
    



   UO.Print( "Stored " + str(count) + " people in range. Now Casting..." ) 
    
   UO.Say(".disarm") 
   Wait(1000) 


      i = 0 
      Repeat 

          
         UO.DeleteJournal() 
         UO.Print("Casting on: " + str(i + 1) + " Serial: " + people[i]) 
         
    UO.WaitTargetObject(people[i]) 
    UO.Exec ("cast 'Bless'")
	Wait(4000)
	UO.WaitTargetObject(people[i])
	UO.Exec ("cast 'Strength'")
	Wait(4000)
	UO.WaitTargetObject(people[i])
	UO.Exec ("cast 'Agility'")
	Wait(4000)
	UO.WaitTargetObject(people[i])
	UO.Exec ("cast 'Cunning'")
	Wait(4000)
	UO.WaitTargetObject(people[i])
	UO.Exec ("cast 'Arch Protection'")
	Wait(4000)
         Repeat 
            Wait(200) 
            time = time + 200 
         Until UO.InJournal("Chip") OR time > 600 
         time = 0 
         i = i + 1 
      Until i == count 
 
   UO.Say("You must stand closer!") 
end sub 



# # # # # # # # # # # # # # # # # # # # # # # # # # #

sub female() 
UO.say("Females get blessed now")
   var i = 0 
   var time = 0 
   var count 
    
   UO.FindType( '0x0191', '-1', '1' )
   count = UO.FindCount() 
   UO.Print("Found " + str(count) + " trees on screen.") 
    
   dim people[val(str(count))] 

   Repeat 
      UO.FindType( '0x0191', '-1', '1' )
      people[i] = UO.GetSerial('finditem') 
        
      #Check if people found are in range 
      If UO.GetDistance(people[i])>3 Then 
         count = count - 1 
      Else 
         i = i + 1 
      End If 
        
      UO.Ignore('finditem') 
   Until i == count 
   UO.IgnoreReset() 
    



   UO.Print( "Stored " + str(count) + " people in range. Now Casting..." ) 
    
   UO.Say(".disarm") 
   Wait(1000) 

     i = 0 
      Repeat 

          
         UO.DeleteJournal() 
         UO.Print("Casting on: " + str(i + 1) + " Serial: " + people[i]) 
         
    UO.WaitTargetObject(people[i]) 
    UO.Exec ("cast 'Bless'")
	Wait(4000)
	UO.WaitTargetObject(people[i])
	UO.Exec ("cast 'Strength'")
	Wait(4000)
	UO.WaitTargetObject(people[i])
	UO.Exec ("cast 'Agility'")
	Wait(4000)
	UO.WaitTargetObject(people[i])
	UO.Exec ("cast 'Cunning'")
	Wait(4000)
	UO.WaitTargetObject(people[i])
	UO.Exec ("cast 'Arch Protection'")
	Wait(4000)
         Repeat 
            Wait(200) 
            time = time + 200 
         Until UO.InJournal("Chip") OR time > 600 
         time = 0 
         i = i + 1 
      Until i == count 
   
   UO.Say("You must stand closer!") 
end sub 
Yavimaya
Posts: 5
Joined: 2006-11-02 08:17:56

Post by Yavimaya »

well just after posting i saw the problem that was crashing it. now i can go on to perfect it.

Its there for if anyone else wants to use it, as it seems to work, just a few minor bugs....
Post Reply