All pastes #44552 Raw Edit

Stuff

public text v1 · immutable
#44552 ·published 2006-03-05 14:13 UTC
rendered paste body
set %amountofrunes 8
set %buy GINSENG_BLACKMOOR_EYES_OF_NEWT_BATWINGS
Setup:
display ok Dbl click your runebook now you have 2 seconds
wait 2s
call runes.txt
set %runebookid #lobjectid
set %scrolls WTL
event macro 8 1
event macro 8 7
finditem ZJF C_ , #charid
set %packid #findid
ignoreitem #charid
set %buygump bill_gump

Main
for %i 1 %amountofrunes
{
if #weight > #maxweight - 20
halt
Gosub Recall %i
Gosub Findloop
Gosub Charge
}
halt



Sub Findloop
Findloop:
Gosub FindVendor
if %result = false
return
Gosub Name
Gosub Buy %string
if #weight > #maxweight - 20
return
goto findloop

Sub Buy
set %scnt #scnt + 10
buy:
if %scnt =< #scnt
return
gosub walk %findx %findy
Msg %String Buy$
wait 10
if #contname <> %buyGump
goto buy
Loop:
getShopInfo
	if #shopitemname in %buy
	{
	Click 200 82 d
	}
Click 393 204
Wait 5
if #shopcurpos =  #shopcnt
goto complete
goto loop
complete:
gosub walk %findx %findy
Click 513 303 x 150 f
Click 513 331 x 150 f
Click 513 357 x 150 f
click 559 383 x 3 f
Click 513 303 x 150 f
Click 513 331 x 150 f
Click 513 357 x 150 f
click 559 383 x 3 f
Click 513 303 x 150 f
Click 513 331 x 150 f
Click 513 357 x 150 f
Click 365 427
Wait 3s
click 300 167 r
Return







Sub FindVendor
for %x 1 10
{
	Finditem HS_IS g_ , %X
	if #findid <> x
	{
	set %result true
	return
	}
}
set %result false
return

Sub Name
Set %FindX #FindX
Set %FindY #FindY
gosub walk %findx %findy
Msg .easyuo_getname$
Target 5s
Set #LTargetID #FindID
Set #LTargetKind 1
Event Macro 22
Wait 10
IgnoreItem #FindID
Set %String #sysmsg
Str Del %String 1 13
Set %String #strres
Set #Scnt 0
return




;######################################
;#		     Walk	 							      #
;######################################
Sub Walk
Set %Movecnt 0
Set %Movcnt 0
Set %Movx %1
Set %Movy %2
Move1:
Set %Movecnt %Movexnt + 1
Gosub Check
Event Pathfind %Movx %Movy #Charposz
Wait 5
Scanjournal 1
If Get_There In #Journal
Goto Walk1
If ( #charposx = %movx + 1 ) || ( #charposx = %movx - 1 )
{
	if ( #charposy = %movy + 1 ) || ( #charposy = %movy - 1 )
	{
	return
	}
	if ( #charposy = %movy ) || ( #charposy = %movy )
	{
	return
	}
}
if ( #charposy = %movy + 1 ) || ( #charposy = %movy - 1 )
{
	If ( #charposx = %movx + 1 ) || ( #charposx = %movx - 1 )
	{
	return
	}
	If ( #charposx = %movx ) || ( #charposx = %movx )
	{
	return
	}
}
if ( #charposx <> %movx ) || ( #charposy <> %movy )
goto move1
If ( #Charposx = %Movx ) || ( #Charposy = %Movy )
Return
If %Movecnt <= 15
Goto Move1
Walk1:
Gosub Check
Set %Movcnt %Movcnt + 1
Move %Movx %Movy A 2S
If ( #Charposx = %Movx ) || ( #Charposy = %Movy )
Return
If %Movcnt => 15
{
Gosub Recall 1
Goto Main
}
If %Movcnt < 15
Goto Walk
Return


sub ReCall
gosub getcharges
set %curx #charposx
set %cury #charposy
set %runetorecall %1
if %chargesleft <= 1
gosub recharge
for %r 1 16
{
	if %runetorecall = %r
	{
	set %recallx %runex . %r
	set %recally %runey . %r
	}
}
finditem %runebookid
set #lobjectid #findid
event macro 17 0
runeloop:
	if #contsize <> 577_426
	{
	wait 10
	goto runeloop
	}
click %recallx %recally
wait 7s
set %result true
return



Sub Charge
finditem %scrolls
event drag #findid
wait 10
msg 1$
wait 10
finditem %runebookid
set #findmod 20_10
click #findx #findy p
return



sub Bank
Gosub Recall 11
Bank:
Finditem %buyitems C_
if #findid = x
return
event drag #findid
wait 10
key enter
wait 10
click 443 300 p
wait 10
goto bank