hello everyone, i need help to understand how can i have check dura and if all the bags are full i got this from the DoDv4 and i tought it may work but its nor what i do wrong here see the script below
The "onload" is run once when the file is loaded. What your onload does is it changes some values then creates 2 functions "checkdura" and "bag". It does not run these functions. You would have to call them somewhere, either at waypoints or in your profile onleavecombat.
So for example you could add them to your waypoints
The next problem is your functions set the next waypoint as the one with the "tag" of "Nidus Linnu" but there is no waypoint with that tag. You can add the tag to the first waypoint
Thank you Rock5 for your input.. but it seems i s till having problems selling anything it does not sell at all and it does not check the dura as i have it set so it goes to 90 it should go to the merchant to get it repaired.
<!-- FUNCTION CHECKS STRUCTURE ARMS -->
function checkdura()
print("Dura is".. inventory:getMainHandDurability())
if ( dura > inventory:getMainHandDurability() )
then __WPL:setWaypointIndex(__WPL:findWaypointTag("Nidus Linnu"))
end
end
<!-- FUNCTION CHECK BAG -->
function bag()
local bcount = inventory:getItemCount(0)
print("Empty bag count is "..bcount)
if( 5 > bcount )
then __WPL:setWaypointIndex(__WPL:findWaypointTag("Nidus Linnu"))
end
end
And show us what your code looks like now, after the changes you have done.
Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
<!-- FUNCTION CHECKS STRUCTURE ARMS -->
function checkdura()
print("Dura is".. inventory:getMainHandDurability())
if (94 > dura > inventory:getMainHandDurability() )
then __WPL:setWaypointIndex(__WPL:findWaypointTag("Nidus Linnu"))
end
end
<!-- FUNCTION CHECK BAG -->
function bag()
local bcount = inventory:getItemCount(0)
print("Empty bag count is "..bcount)
if( 5 > bcount )
then __WPL:setWaypointIndex(__WPL:findWaypointTag("Nidus Linnu"))
end
end
</onLoad>
<!-- # 1 --><waypoint x="3801" z="-8391" y="445"> player:merchant("Nidus Linnu");
</waypoint>
<!-- # 2 --><waypoint x="3844" z="-8506" y="443"> </waypoint>
<!-- # 3 --><waypoint x="3800" z="-8582" y="443"> </waypoint>
<!-- # 4 --><waypoint x="3668" z="-8733" y="438"> </waypoint>
<!-- # 5 --><waypoint x="3446" z="-8934" y="439"> </waypoint>
<!-- # 6 --><waypoint x="3255" z="-9042" y="440"> </waypoint>
<!-- # 7 --><waypoint x="3106" z="-9099" y="440"> </waypoint>
<!-- # 8 --><waypoint x="2653" z="-9245" y="445"> </waypoint>
<!-- # 9 --><waypoint x="2487" z="-9516" y="452"> </waypoint>
<!-- # 10 --><waypoint x="3813" z="-8392" y="445"> player:merchant("Nidus Linnu");
</waypoint>
<!-- # 11 --><waypoint x="3813" z="-8392" y="445"> </waypoint>
</waypoints>
I just checked the character and it is right now at 88% dura it should had gone to the merchant and get repaired and sell the stuff from the backpack but it has not done so so i really don't understand why its not working. thank you again for the help
GM detection started
We changed the option 'AUTO_ELITE_FACTOR' from '5' to '1000'.
We changed the option 'INV_AUTOSELL_ENABLE' from 'true' to 'true'.
Moving to waypoint #5, (3446, -8934)
Dura is100
Did not find any crashed game clients.
10:22pm - [string "..."]:14: attempt to compare number with boolean
AL lib: FreeContext: (00390E60) Deleting 1 Source(s)
Please enter the script name to run.
Type in 'exit' (without quotes) to exit.
Script>
and here is the code i'm not sure if i did it right do....
<!-- FUNCTION CHECKS STRUCTURE ARMS -->
function checkdura()
print("Dura is".. inventory:getMainHandDurability())
if (94 > dura inventory:getMainHandDurability() )
then __WPL:setWaypointIndex(__WPL:findWaypointTag("Jahos Tindo"))
end
end
<!-- FUNCTION CHECK BAG -->
function bag()
local bcount = inventory:getItemCount(0)
print("Empty bag count is "..bcount)
if( 5 > bcount )
then __WPL:setWaypointIndex(__WPL:findWaypointTag("Jahos Tindo"))
end
end
Thank you Lisa this did the fix for the boolean error but I'm not sure why its not going back to the merchant to get repaired or why it not going back if the backpack is full any help is very much appreciated. thank you
You still haven't done everything I told you to do.
I'll try to explain it again. Maybe I wasn't explaining properly.
The "onload" section of the waypoint file executes only once at the start of execution. In your onload section it creates 2 functions. It does not run them. Once the functions are created they have to be run. When do you want them to run, ie. when do you want it to check the bag space and dura? At the moment they are not run.
Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
Hello again, sorry to bug you all again with this but it seems not to be working for me so i would like to ask what other way is the best way to handle this. As rock5 said the onload is a function that needs to be called for it is their another way to add this in to the waypoint without the onload command. here below is the script again this time i re-created a waipoint with 10 waypoints and i set it up at number 9 that is where the character needs to stand and kill everything around. Thanks again for the help. ahh before i forget i made sure that everything is updated micromacro rev.43 and rom rev.576
<!-- FUNCTION CHECKS STRUCTURE ARMS -->
function checkdura()
print("Dura is".. inventory:getMainHandDurability())
if (94 > inventory:getMainHandDurability() )
then __WPL:setWaypointIndex(__WPL:findWaypointTag("Jahos Tindo"))
end
end
<!-- FUNCTION CHECK BAG -->
function bag()
local bcount = inventory:getItemCount(0)
print("Empty bag count is "..bcount)
if( 5 > bcount )
then __WPL:setWaypointIndex(__WPL:findWaypointTag("Jahos Tindo"))
end
end
Do you want it to check after every battle? We often use the profile onleavecombat for this. We can change it from the waypoint file. Try adding this to the waypoint onload.
if oldOnLeaveCombat == nil then oldOnLeaveCombat = settings.profile.events.onLeaveCombat end
function settings.profile.events.onLeaveCombat()
if oldOnLeaveCombat then oldOnLeaveCombat() end
checkdura()
bag()
end
If you are having the problem that the mobs never run out because they respawn too fast, you might have to change the waypoint type to ignore mobs so it can head back. Add the following line to the bag and checkdura function.