Yoko

All sides of Injection
It is currently 2025-12-30 07:42:00

All times are UTC+02:00




Post new topic  Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Need help with my script
PostPosted: 2006-06-21 22:56:15 
Offline

Joined: 2006-06-14 00:19:39
Posts: 1
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


Top
   
PostPosted: 2006-06-21 23:25:38 
Offline
Expert!

Joined: 2004-04-03 17:36:29
Posts: 2544
Location: Saint-Petersburg
nightsun wrote:
Code:
SetGlobal("kom","1")                   <------ PROBLEM

UO.SetGlobal("kom","1")
Quote:
Code:
if  UO.GetGlobal("kom") == "1" then    <---------  THIS RIGHT?

yes
Quote:
Code:
uo.useobject(corpse) ; open corpse

you don't need in serial of corpse, you can use 'lastcorpse':
uo.useobject('lastcorpse')
Quote:
Code:
   UO.FindType( 'DEG', '-1', 'lastcorpse' )
   uo.waittargetobject('finditem')
   uo.usetype('JAG')

Correct it:
Code:
   UO.FindType( 'DEG', '-1', 'lastcorpse' )
   If YO.FindCount() > 0 Then
      uo.waittargetobject('finditem')
      uo.usetype('JAG')
   Endif

_________________
Ни один скрипт не работает? Пора обновить Инжект...
Все работает, но хочется большего? Пора переходить на стелс...


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 1 guest


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