Grape Juice Quest macro

Moderator: Moderators

Message
Author
nfd7
Noob
Noob
Posts: 1
Joined: 29 Jun 2008, 16:16
Noob?: No

Grape Juice Quest macro

#1 Post by nfd7 »

Being very new to macro, I have encountered a few errors that I could not debug on my own.
In my server there is a warp NPC and NPCs that sell grapes and bottles.

this is my first macro, It seems that the macro guide is outdated:
[anything in brackets does not exist in the actual macro]

[this automacro opens up my shop when I start openkore. IDK if it is effecient or not but it works]
automacro initializeshop {
run-once 1
location payon
call openshop
}
macro openshop {
do openshop
}
[I've tried many things to try to get this automacro to work, as you can see, but I want it to initialize moveit macro when my shop sells out, or I simply have no grape juice left in my card or in my shop]
automacro startgj {
cart "grape juice" == 0
shop "grape juice" == 0
soldout == 1
call moveit
}
[this is my main driver for the macro, it works flawlessly until I reach the actual grape juice quest where on occasion it fails to deposit 2000 grape juice from inventory to cart, although when I retested the macro changing the quantities of grapes and empty bottles taken at a time to be made to 5, it worked100% of the time, a strange bug]
macro moveit {
$vendspot = $.pos [not used idk why i still have it there]
do move 148 212 payon
do talk @npc (147 212)
do store
do store
do buy 11 6000
[buys 6000 grapes]
do move 163 213 payon
do talk @npc (164 213)
pause 2
do talk resp 1
do storage add @inventory (grape) @eval (@invamount (grape) - 2000)
[stores all but 2000 grapes to avoid overweight later on]
do move 163 216 payon
do talk @npc (164 216)
pause 2
do talk resp 1
[warp npc to alberta]
do move 98 40 alberta
do talk @npc (97 40)
do store
do store
do buy 1 2000
do talk @npc (101 47)
pause 2
pause 2
do talk resp 1
do storage add @inventory (empty bottle) 2000
do talk @npc (97 40)
do store
do store
do buy 1 2000
do talk @npc (101 47)
pause 2
pause 2
do talk resp 1
do storage add @inventory (empty bottle) 2000
do talk @npc (97 40)
do store
do store
do buy 1 2000
[has to store bottles in quantities of 2000 to stay under weight limit]
do move 111 129 alberta
do talk @npc (110 129)
pause 2
pause 2
do talk resp 2
pause 2
do talk resp 2
[grape juice quest]
do move 181 143 payon_in03
pause 3
do talk @npc (188 146)
pause 2
do talk resp 0
do talk resp 3
do talk resp 0
pause 2
pause 2
do cart add @inventory (grape juice) 2000
do cart add @inventory (grape juice) 2000
do move 138 321 payon
pause 3
do talk @npc (137 321)
pause 2
do talk resp 1
do storage get empty bottle 2000
do storage get grape 2000
do move 181 143 payon_in03
pause 3
do talk @npc (188 146)
pause 2
do talk resp 0
do talk resp 3
do talk resp 0
pause 2
pause 2
do cart add @inventory (grape juice) 2000
do cart add @inventory (grape juice) 2000
do move 138 321 payon
pause 3
do talk @npc (137 321)
pause 2
do talk resp 1
do storage get empty bottle 2000
do storage get grape 2000
do move 181 143 payon_in03
pause 3
do talk @npc (188 146)
pause 2
do talk resp 0
do talk resp 3
do talk resp 0
pause 2
pause 2
do cart add @inventory (grape juice) 2000
do cart add @inventory (grape juice) 2000
do move 162 209 payon
pause 5
do openshop
}

if you are wondering about all the unnecessary pauses, it is because my ISP blows, I even have global delay set to 2 seconds and it still requires those pauses.

anyways any ideas or improvements to the code? thanks for helping !