Yoko

All sides of Injection
It is currently 2025-11-02 21:39:12

All times are UTC+02:00




Post new topic  Reply to topic  [ 6 posts ] 
Author Message
PostPosted: 2005-02-11 01:56:37 
Offline

Joined: 2004-11-22 16:12:44
Posts: 4
here is it.
Code:
- - - - - - - - - - - - - - - - - - - - - - - - - - -
var f = file("c:\personal.map")
var secure = "0x5869C707"


sub main()
open_file()
empty_bottle()
read_maps()
close_file()
end sub

sub open_file()
f.open()
f.writeln("3")
end sub

sub close_file()
f.close()
end sub

sub read_maps()
while uo.count("0x14ED") > 0
read_put()
write_coord()
wend
end sub

sub write_coord()
var testo = UO.lastgump("text",1)
var coord = ""
for var i = 0 to (STRLEN(testo)-1)
if (testo[i] >= "0") and (testo[i] <= "9") then
coord = coord + testo[i]
end if
if testo[i] == "," then
coord = coord + " "
end if
next

testo = UO.lastgump("text",2)
for i = 0 to (STRLEN(testo)-1)
if (testo[i] >= "0") and (testo[i] <= "9") then
coord = coord + testo[i]
end if
if testo[i] == "," then
coord = coord + " "
end if
next

f.writeln("-point of interest: "+coord+" 1 tesoro")

end sub




sub read_put()
uo.findtype("0x14ED")
UO.useobject("finditem")
wait(500)
UO.LDblClick(154,157)
wait(500)
UO.setreceivingcontainer(secure)
wait(500)
UO.grab(1,"finditem")
wait(500)
UO.unsetreceivingcontainer()
end sub


sub empty_bottle()
while uo.count("0x099F") > 0
uo.usetype("0x099F")
wait(100)
wend
end sub
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Note: you have to create an empty file BEFORE: "C:\personal.map"
then you can use directly with Automap.



i'm just posting it here 'cause i'm gettin tired to play ultima, and want to save some of my "script - products".

as Sting said

"Walked out this morning
Don’t believe what I saw
A hundred billion bottles
Washed up on the shore
Seems I’m not alone at being alone
A hundred billion casatways
Looking for a home"


Top
   
 Post subject:
PostPosted: 2005-02-11 22:40:33 
Offline
Junior Expert

Joined: 2004-09-18 15:12:06
Posts: 138
yokofan! wrote:
SO guys, i just wanna know how to make a decimal nuber be the most near nondecimal number...


1.1 = 1
1.9 = 2
1.555556=2



thnks

int(x+0.5)


Top
   
 Post subject:
PostPosted: 2005-02-12 13:28:55 
Offline
Junior Expert

Joined: 2004-09-18 15:12:06
Posts: 138
yokofan! wrote:
I have already started mod klappo script, but i stopt at here:

Code:
 coox=mid(coord,1,4)
 gx=mid(coox,1,2)
 mx=mid(coox,3,2)
 mx=mx * 60   --------------------------------   HERE
 coox=gx.mx
 dx=int(coox+0.5)
 tx = dx * 5120 / 360 + 1323


Image

i just want mutyple mx by 60, whats the way to make this? thank u guys


mid function returns a string. You should convert it to number via val function. Like this:
Code:
mx=val(mid(coox,3,2))


Top
   
 Post subject:
PostPosted: 2005-02-12 18:27:53 
Offline
Junior Expert

Joined: 2004-09-18 15:12:06
Posts: 138
Be aware of type of operands of + operator. If You want use it as string concatenation, You must convert all operands to string form:
Code:
STR(gx) + "." + STR(mx)


Top
   
 Post subject:
PostPosted: 2005-02-12 23:13:58 
Offline
Junior Expert

Joined: 2004-09-18 15:12:06
Posts: 138
yokofan! wrote:
The modd is preatty fishined, now i just want add some things like uo.recall() unless uo.rclick() and uo.moveitem()/uo.ignore() unless uo.grab()/uo.setreceivercontainger() and fix repeation, but i dont know how its loops, can some onde helpme?

i cant see nothink like while or goto... just subs and ifs

There are 3 sorts of loops in Injection scripts:
Code:
while condition
    operators
wend

repeat
    operators
until condition

for i = 0 to 10
    operators
next

Need explanations?


Top
   
 Post subject:
PostPosted: 2005-02-24 05:17:06 
Offline
User avatar

Joined: 2004-11-07 01:22:35
Posts: 291
Location: Черкассы
Try
Code:
gxlen= gxlen - gylen 
gxlen= gxlen - mylen 


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

All times are UTC+02:00


Who is online

Users browsing this forum: No registered users and 7 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:  
cron
Powered by phpBB® Forum Software © phpBB Limited