12
« on: August 26, 2008, 07:59:35 AM »
My big problem is setting up my resource bag so that it ask for it in the begining of the script and then will call it back when it is time to use it for the restock. this is my code so far i understand it needs a bunch of work yet, but i dont feel i can move on till this gets figured out. here is my script as of now
;========================================
;Name: XxCaptainxX's Heal & Warn
;Author: XxCaptainxX
;Version: What comes befor beta? Smiley
;========================================
set %fullheal You_finish_applying_the
set %retry You_apply_the_bandages
set %lilheal You_heal_what_little_damage_your
set %tryagain That_being_is_not_damaged
set %wait You_must_wait_to_perform_another_action
gosub setsecure
mainloop:
gosub counter
gosub check
gosub heal
gosub restock
goto mainloop
;-------Set-up-secure-pack---------------
sub setsecure
display yesno Are you using your bank?$
if #dispRes = yes
{
nextCPos 25 500
msg Bank$
wait %short_delay
}
display OK Please target your supply container.$
wait %short_delay
set #targcurs 1
wait %short_delay
WaitTarget:
if #targcurs = 0
{
set %resourcebox #ltargetid
return
}
goto WaitTarget
return
;-------Counter-(Crosses-Fingers)--------
sub counter
finditem ZLF C_ , #backpackid
if #findkind = 0 && #findstack <= 20
EVENT ExMsg #charID 3 33 You are Low on bandaids!
if #findkind = -1
event exmsg #charid 3 33 You are out of bandaids!
return
;-------Checker-(Maybe)------------------
sub check
If #hits < #maxHits
{
return #true
}
return #false
;-------Heal-(hopefully)-----------------
sub heal
if #result #true
finditem ZLF c_ , #backpackid
{
if #findkind = 0 ; -1 not found, 0 in a container, 1 on the ground
{
set #lobjectId #findId
event macro 17
target 5s
event macro 23
repeat
{
wait 0
}
until %fullheal in #sysmsg || %lilheal in #sysmsg || %retry in #sysmsg || %tryagain in #sysmsg || %wait in #sysMsg
}
return
;------Restocker-(Kind-Of)----------------
Sub restock
finditem ZLF C_ , #backpackid ; this is bandaids
if #findstack < 25
{
set %tograb 100 - #FINDSTACK
set #lobjectid %resourcebox
wait %vSwait
event macro 17 0
wait %vSwait
contpos 0 0
wait %vSwait
Finditem ZLF C_ , %resourcebox
IF #FINDSTACK >= %tograb
{
exevent drag #findid %tograb
exevent dropc #backpackid
wait %MSwait
}
}
return
if i do the restock with my personal resource bag ID setup in it it works fine so i know it is just a problem of recalling my initial setup
p.s. be at the bank when you initialy start this up and have a bag with aids in it.