set %material ZLK
set %ready_material TLK
set %material_quanty 30
set %storage GBXVDND
repeat
finditem %material C_ , #BACKPACKID
if #FINDCNT <= 10
{
finditem %ready_material C_ , #BACKPACKID
if #FINDCNT > 0
{
gosub move_all %ready_material all #BACKPACKID %storage
}
gosub move %material %material_quanty %storage #BACKPACKID
}
while #charghost = yes
wait 0
until #charghost = yes
sub move_all
finditem %1 C_ , %3
while #findcnt > 0
{
if %2 = all
exevent drag #FINDID #FINDSTACK
else
exevent drag #FINDID %2
wait 10
Exevent Dropc %4
wait 1s
finditem %1 C_ , %3
}
return
sub move
finditem %1 C_ , %3
if %2 = all
exevent drag #FINDID #FINDSTACK
else
exevent drag #FINDID %2
wait 10
Exevent Dropc %4
wait 1s
return
repeat
...
while #charghost = yes
wait 0
until #charghost = yes
repeat
...
until #FALSE
set %material ZLK
set %ready_material TLK
set %material_quanty 5
set %storage GBXVDND
repeat
finditem %material C_ , #BACKPACKID
if #FINDCNT < 0 || #FINDSTACK < 10
{
finditem %ready_material C_ , #BACKPACKID
if #FINDCNT > 0
{
gosub move_all %ready_material all #BACKPACKID %storage
}
gosub move %material %material_quanty %storage #BACKPACKID
}
while #charghost = yes
wait 0
until #FALSE
sub move_all
finditem %1 C_ , %3
while #findcnt > 0
{
if %2 = all
{
exevent drag #FINDID #FINDSTACK
}
else
{
exevent drag #FINDID %2
wait 10
Exevent Dropc %4
wait 1s
finditem %1 C_ , %3
}
}
return
sub move
finditem %1 C_ , %3
if %2 = all
{
exevent drag #FINDID #FINDSTACK
}
else
{
exevent drag #FINDID %2
wait 10
Exevent Dropc %4
wait 1s
}
return
set %material ZLK
set %ready_material BTL
set %material_quanty 100
set %tools EGG_IGG
set %storage GBXVDND
set %tool_box GBXVDND
set %trash KHELNND
set #LOBJECTID %storage
event macro 17
wait 1s
set #LOBJECTID %tool_box
event macro 17
wait 1s
finditem %tools C_ , #BACKPACKID
if #FINDCNT > 0
{
set #lobjectid #FINDID
event macro 17
gosub waitforgump 530_437
gosub clickmod 27 93
gosub waitforgump 530_437
gosub clickmod 235 93
}
else
{
finditem %tools C_ , %tool_box
if #FINDCNT > 0
{
gosub move %tools 1 %tool_box #BACKPACKID
}
else
{
display ok You'r out of tools.
halt
}
}
repeat
finditem %material C_ , #BACKPACKID
if #FINDCNT < 0 || #FINDSTACK < 10
{
finditem %ready_material C_ , #BACKPACKID
if #FINDCNT > 0
{
gosub move_all %ready_material all #BACKPACKID %trash
}
finditem %material C_ , #BACKPACKID
if #FINDCNT <= 0 || #FINDSTACK <= 10
{
finditem %material C_ , %storage
if #FINDCNT <= 0 || #FINDSTACK <= 10
{
gosub move_all %ready_material all #BACKPACKID %trash
gosub move_all %material all #BACKPACKID %storage
display ok You'r out of resources.
halt
}
gosub move %material %material_quanty %storage #BACKPACKID
}
}
gosub make
while #charghost = yes
wait 0
until #FALSE
sub move_all
finditem %1 C_ , %3
while #findcnt > 0
{
if %2 = all
{
exevent drag #FINDID #FINDSTACK
}
else
{
exevent drag #FINDID %2
}
wait 10
Exevent Dropc %4
wait 1s
finditem %1 C_ , %3
}
return
sub move
finditem %1 C_ , %3
if %2 = all
{
exevent drag #FINDID #FINDSTACK
}
else
{
exevent drag #FINDID %2
}
wait 10
Exevent Dropc %4
wait 1s
return
sub clickmod
set %x #contposx + %1
set %y #contposy + %2
click %x %y %3
return
sub waitforgump
set %timeout #scnt + 10
while #contsize <> %1
{
wait 1
if #scnt > %timeout
{
return #false
}
}
wait 0
return #true
sub make
finditem %tools C_ , #BACKPACKID
if #FINDCNT > 0
{
while #findcnt > 0
{
set %current_tool #FINDID
set #lobjectid %current_tool
event macro 17
finditem %current_tool C_ , #BACKPACKID
while #findcnt > 0
{
finditem %material C_ , #BACKPACKID
if #FINDCNT < 0 || #FINDSTACK < 10
{
return
}
gosub waitforgump 530_437
finditem %current_tool C_ , #BACKPACKID
if #findcnt < 0
{
return
}
gosub clickmod 288 413
}
}
}
else
{
finditem %tools C_ , %tool_box
if #FINDCNT > 0
{
gosub move %tools 1 %tool_box #BACKPACKID
}
else
{
if #CONTSIZE 530_437
{
contpos 0 0
wait 10
click 0 0 r
}
gosub move_all %ready_material all #BACKPACKID %trash
gosub move_all %material all #BACKPACKID %storage
display ok You'r out of tools.
halt
}
}
return