Need help with my script

Ask for help

Moderators: Murderator+, Murderator

Post Reply
nightsun
Posts: 1
Joined: 2006-06-14 00:19:39

Need help with my script

Post by nightsun »

Greetings,

I am new on this coding stuff and i was wondering if you could help me with my script. I don't understand russian so only english advices please.

I have a quite bunch of problems because i don't understand those russian manuals.

Firstly I can't get my global variables working. I always get function not found -SETGLOBAL/-GETGLOBAL error message. Aren't those supposed to be variables not functions?

Secondly what is the unequal marking? I mean opposite to the equal "==" marking used for example in if-sentences.

Script is supposed to collect leather from corpses automatically when i walk near them. Leather collecting part is already working quite well but those global variables are giving me a big headache since i need some way to "tell" the script not to start looting already looted corpse again. The script itself is supposed to run in a endless loop.

Is there any sites explaining injection scripting related commands, variables etc.. or somekind of guide in english?

Any other comments are also welcome.

This is my script:

sub main()

SetGlobal("kom","1") <------ PROBLEM


repeat

if UO.GetGlobal("kom") == "1" then <--------- THIS RIGHT?
if uo.getdistance( 'lastcorpse' ) <2 then
Autoloot()
else
endif
else
endif



until uo.dead()

end sub


sub AutoLoot()

var corpse = uo.getSerial('lastcorpse') ; corpse for looting

UO.waittargetobject('lastcorpse')
UO.usetype('WSF') ;Type - DAGGER
wait(500)

uo.useobject(corpse) ; open corpse
wait(500)

UO.FindType( 'DEG', '-1', 'lastcorpse' )
uo.waittargetobject('finditem')
uo.usetype('JAG')

wait(500)

UO.FindType( 'JJG', '-1', 'lastcorpse' )
while uo.findcount()
uo.moveitem('finditem',"0","backpack")
wait(500) ; fastloot pause
UO.FindType( 'JJG', '-1', 'lastcorpse' )
SetGlobal("kom","2") <-------- NOT WORKING


end sub
Edred
Expert!
Posts: 2544
Joined: 2004-04-03 17:36:29
Location: Saint-Petersburg

Re: Need help with my script

Post by Edred »

nightsun wrote:

Code: Select all

SetGlobal("kom","1")                   <------ PROBLEM

UO.SetGlobal("kom","1")

Code: Select all

if  UO.GetGlobal("kom") == "1" then    <---------  THIS RIGHT?

yes

Code: Select all

uo.useobject(corpse) ; open corpse

you don't need in serial of corpse, you can use 'lastcorpse':
uo.useobject('lastcorpse')

Code: Select all

   UO.FindType( 'DEG', '-1', 'lastcorpse' )
   uo.waittargetobject('finditem')
   uo.usetype('JAG')

Correct it:

Code: Select all

   UO.FindType( 'DEG', '-1', 'lastcorpse' )
   If YO.FindCount() > 0 Then
      uo.waittargetobject('finditem')
      uo.usetype('JAG')
   Endif
Ни один скрипт не работает? Пора обновить Инжект...
Все работает, но хочется большего? Пора переходить на стелс...
Post Reply