Yoko

All sides of Injection
It is currently 2025-10-12 17:29:22

All times are UTC+02:00




Post new topic  Reply to topic  [ 2 posts ] 
Author Message
PostPosted: 2009-12-12 17:39:46 
Offline

Joined: 2009-10-16 16:57:23
Posts: 8
We know,use inj's 'laststatus',first spell a lighting on enemy,then use healself,'laststatus' will equal 'self',the next lighting will point self.

So I wanna make a script who can lock EnemyID by 'laststatus'.
But i am confused with Inj Script's var scope.
Below is a piece of my script
Code:
var EnemyID
var EnmMode=1
var Locked

sub LockEnemy()
      Locked=0
      if uo.GetSerial('self')==uo.Getserial('laststatus') then
         uo.print("NO to self")
         return
      endif
      EnemyID=uo.Getserial('laststatus'))
      uo.print("EnemyID Stored!")
      Locked=1
end sub

Sub JPara()
    Var Type='0x1F52'
    Var Color='0x0000'
    if uo.GetSerial('self')==uo.GetSerial('laststatus') then
       uo.print("Dont Point to Self!")       
       return
    endif
    if EnmMode==1 then
       if Locked==1 then
          UO.Set('lasttarget',EnemyID)
       else
          uo.print("Lock Enemy first!")
       endif
    else
       UO.Set('lasttarget','laststatus')
    endif
    UO.FindType(Type,Color,2)
    if uo.findcount()>0 then
       uo.WaitTargetLast()
       UO.UseObject('finditem')     
    else   
       UO.print("No Paralyze Scroll!")
    endif
Endsub

But the "Locked" and "EnemyID" all are temporary var in 1st sub.
How to modify this script to make it work?
Thx a lot.

I already tryed uo.Getglobal() and uo.SetGlobal(),but it's text,especially for uo.Getserial('laststatus'),we need a Hex value,not just string.

So,Please help me!


Top
   
 Post subject:
PostPosted: 2009-12-12 18:39:06 
Offline

Joined: 2009-10-16 16:57:23
Posts: 8
Maybe I have solved ! Haha!
Code:
var LockMode=1
sub LockEnemy()
    uo.SetGlobal('Locked',"0")
    if uo.GetSerial('self')==uo.Getserial('laststatus') then
       uo.print("NO to self")
       return
    endif
    uo.setglobal('EnemyID',uo.Getserial('laststatus'))
    ;uo.print(uo.getglobal('EnemyID'))
    uo.print("EnemyID Stored!")
    uo.setglobal('Locked',"1")
end sub

sub GetTarget()
    if uo.GetSerial('self')==uo.GetSerial('laststatus') then
       uo.print("Dont Point to Self!")       
       return 0
    endif
    if LockMode==1 then
       if val(uo.GetGlobal('Locked'))==1 then
          UO.Set('lasttarget',uo.getglobal('EnemyID'))
     return 1
       else
          uo.print("Lock Enemy first!")
     return 0
       endif
    else
       UO.Set('lasttarget','laststatus')
       return 1
    endif   
endsub

Sub JPara()
    Var Type='0x1F52'
    Var Color='0x0000'
    if GetTarget()==0 then
       return
    endif
    UO.FindType(Type,Color,2)
    if uo.findcount()>0 then
       uo.WaitTargetObject('lasttarget')
       ;uo.WaitTargetLast()
       UO.UseObject('finditem')     
    else   
       UO.print("No Paralyze Scroll!")
       Para()
    endif
Endsub

Anybody has better solution?
AddObject()?


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 2 posts ] 

All times are UTC+02:00


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Limited