Page 1 of 1

Farming Error

Posted: Wed Jul 31, 2013 4:51 pm
by BeyondNames
Ok im back xD
when i run the bot while im farming i tried to make it check my inventory and if i had a certain amount of the stuff to switch waypoints to a logout WP and change Chars and repeat
the bot acts like the other instructions arnt even there
i copied the check inventory part of the script from another WP that worked
pls help
also if i shouldnt use another WP to logout and change chars please help me with the 2
I will link the two WPs

Re: Farming Error

Posted: Wed Jul 31, 2013 5:11 pm
by evenhasawatermark
Make the code into a function, stick it into your onLoad, then call the function at the waypoint.

Re: Farming Error

Posted: Wed Jul 31, 2013 6:50 pm
by BeyondNames
I dont know how to create a function or how to call the function at the waypoint so please explain :)

Re: Farming Error

Posted: Wed Jul 31, 2013 8:41 pm
by evenhasawatermark

Re: Farming Error

Posted: Thu Aug 01, 2013 1:41 am
by rock5
When you type

Code: Select all

function functionname()
    -- your code here
end
it 'creates' the function but it doesn't run it. To 'use' the function you would then type

Code: Select all

functionname()
We could make the logout.xml file work but the right way to do it is to put the relog function in the onload of the first file (so it 'creates the function when the file is loaded) and then 'use' the function at the appropriate place, eg.

Code: Select all

if inventory:itemTotalCount("Guard Dog Meat") > 1 then relog() end

Re: Farming Error

Posted: Thu Aug 01, 2013 6:14 pm
by BeyondNames
My Wp is like this now and i got this error

Code: Select all

The game client did not crash.
4:13pm - .../ROM PVP/micromacro/scripts/rom/classes/waypointlist.lua:83: Failed
to compile and run Lua code for waypointlist onLoad event.


AL lib: FreeContext: (02BBCCC8) Deleting 1 Source(s)
Please enter the script name to run.
Type in 'exit' (without quotes) to exit.
Script>

Re: Farming Error

Posted: Fri Aug 02, 2013 12:30 am
by rock5
You missed the relog functions 'end'. Add an 'end' between these 2 lines.

Code: Select all

		loadPaths("DogMeatLONG");
	setwindow("Guard Dog Meat")

Re: Farming Error

Posted: Fri Aug 02, 2013 2:26 pm
by BeyondNames
i got it to work thank you so much