Closed ytbro00 closed 7 years ago
hello! i think i can help you. here is the code optimized
automacro moveToMaster {
eval ($field->isCity) #the automacro will only trigger if is inside city
#(which happens when you die or use butterfly wing, or do autostorage, autosell)
call {
do autosell
do autobuy
do conf lockMap
do conf lockMap_x
do conf lockMap_y
do move payon 100 100 #just an example
}
run-once 1
}
automacro dealToMaster {
location payon 100 100 #example
call {
do deal @player
pause 3
$zenyToGive = @eval($.zeny - 100000)
if ( $zenyToGive > 0 ) do deal add z $zenyToGive
#this way it will add any zeny that you have and keep 100k
pause 1
while (@invamout(Hood [1] != 0) as loop1
do deal add @inventory(Hood [1]) #just put a while in every equip, just like that
end loop1
pause 1
do deal
pause 1
do deal
}
run-once 1
}
automacro moveToFild { #where my bots are farming
console /Deal Complete/i
call {
do conf lockMap
do conf lockMap_x none
do conf lockMap_y none
do move
do reload mac
}
}
is there anything else?
Can I ask if the item more than 10 in a time, how to deal again?
I don't know how...you have to check every single item that you pass normally, check if has 0 of the item You have to do this in the last macro, that ends the deal And if some of the items it's more than 0 Call the dealToMaster again
Maybe trig when deal is full , then do deal and call again
it's an ideia, but how the bot knows when to stop this loop?
Hi, thanks nipodemos. I tried running the code, although I was getting [macro] dealToMaster.call error: error in 5: error in 5: error in 5: You probably missed 1 or more closing round- bracket ')' in the statement.
This was the error for zeny line. This got it to work though.
if ($.zeny >= 400000) {
do deal add z @eval($.zeny - 100000)
}
Now I have the same message for equipment adding, tried placing a bracket for the equipment lines but if I do that it ignores everything below it. Removing the while condition and trading equipment successfully completes the macro though so just trying to figure out how to fix dealing equipment.
This is what I currently have excluding the do deal and above lines.
pause 3
if ($.zeny >= 400000) {
do deal add z @eval($.zeny - 100000)
}
pause 1
while (@invamout(Hood [1] != 0) as loop1
do deal add @inventory(Hood [1]) #just put a while in every equip, just like that
end loop1
pause 1
do deal
pause 1
do deal
}
run-once 1
}
Tried this also but it got me errors and shut off openkore
pause 1
$hoods = @Inventory(Hood [1])
while ($hoods != -1 || $hoods != "") as loop
do deal add [$hoods]
pause 1
end loop
pause 1
$hoods = @Inventory(Hood [1]) while ($hoods != -1 || $hoods != "") as loop do deal add [$hoods] pause 1 end loop
why do deal add [$hoods]
have these things surrounding $hoods?
i believe that you can't put the e"||" inside while maybe... but the good thing is $hood will not have an empty value. Try like this:
$hoods = @Inventory(Hood [1])
while ($hoods != -1 ) as loop
do deal add $hoods
pause 1
end loop
if you try this, and still get an error, try use the @inventory all in lowercase.
Alright, thanks Nipodemos.
That did the trick and it did add the equipments I wanted it to add. The end loop doesn't seem to work though and it keeps trying to add the items again. For this test I used mufflers.
i said in the end, use @inventory in lowercase. you are using with the first letter in upper case, that returns several numbers and it's harder to deal with. use @inventory all in lowercase
I did that earlier. But using @inventory in lower case only added 19 and does not add anything after that, while looping the same message.
"Error in function 'deal_add' (Add Item to Deal) Inventory Item 19 does not exist."
The one with @Inventory worked as above, added everything but loops.
EDIT:
Got it to work using this. Going to test it a bit.
$list = @Inventory(#itemname)
while ($list != -1 && $list != "") as loop
do deal add $item
}
Oh Sorry , In that case, put the variable inside the while loop. So in every loop it will update its value Or learn to extract just one of the values per time of @Inventory with uppercase letter ( I don't know how, but I know it's possible
The first solution is a lot easier
Got it to work @Nipodemos edited my post up there took a few tweaks seems good now. Thanks for the assistance.
Although a little bit worried with the series of macros. Since I have a couple of bots running and the merchant will go to sell the items once it gathers everything.
This one I'm not really sure how, but how would I got about farmer slave bot checking if the master bot is in its spot? If the master isn't there just continue on and go to the farming location.
Also, going to test it out a bit but since I have a couple of slave bots running around, they might try to deal the master at the same time and get stuck.
You have to use eval for this one... Unfortunately I don't know which eval you have to use... Macro plugin it's veeeeeeeeeery incomplete ...
I know it may seem difficult to you, but have you tried eventMacro plugin ? It's a rework of the plug-in you currently uses, and it is much more complete , much more ... In eventMacro, you can use the condition PlayerNear , that checks if the player you specify is near , it would solve this issue
For more support use: htttp://www.openkore.com
Not entirely a big issue. Still trying to learn how to use macros. Thanks to anyone that can help.
So I'm trying to have my bots autodeal my merchant as soon as they're done auto selling & auto buying. My actual macro itself partially works. I'd just like to tweak on the trigger and auto adding. So here's a modified sample of what I'm trying to tweak around on.
I did not put weight trigger because I have my bots set to go back for auto buying and selling once they run out of potions and fly wings. Which is why I'm trying to get the macro to trigger as soon as I get to town. It actually only works if I add weight on it, if I remove it, I have to reload all configs to trigger this macro.
Trying to use zenyChecks to leave at least 50k - 100k on my farming bots so that they have enough money to auto-buy what they need?
I've been able to successfully add numerous amounts of items by adding the same line. Can anyone clarify if it's possible to just keep adding the same item like composite bow, wooden mail, knife until there are none left to trade without having to add multiple lines of the do deal add @inventory?
Any help is appreciated. Thanks.