How exactly does a local variable gets increased?
How exactly does a local variable gets increased?
i have a waypoint thats basicly a round of harvesting.
i want to do this 3 times, then move away to dump.
so i do know i use Local Counter
but how do i increase the Counter variable after a round? is it as in other languages?
so counter = counter +1?
any help is apriciated ^^
Botje
i want to do this 3 times, then move away to dump.
so i do know i use Local Counter
but how do i increase the Counter variable after a round? is it as in other languages?
so counter = counter +1?
any help is apriciated ^^
Botje
Re: How exactly does a local variable gets increased?
I have done it like this:
I am not sure if its possible to do shorter way:
or is is +=? I never remember. =+ would be more logical tho.
Code: Select all
player.free_counter1 = player.free_counter1 + 1;
Code: Select all
player.free_counter1 =+ 1;
Re: How exactly does a local variable gets increased?
I never heard of that being available in lua.
Just tried both. Neither works.
We'll just have to do it the long way.
Just tried both. Neither works.
We'll just have to do it the long way.
- 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.
- How to: copy and paste in micromacro
________________________
Quote:- “They say hard work never hurt anybody, but I figure, why take the chance.”
- Ronald Reagan
- Administrator
- Site Admin
- Posts: 5307
- Joined: Sat Jan 05, 2008 4:21 pm
Re: How exactly does a local variable gets increased?
The += operator is not available in Lua. =+ would not be more logical because it would be a parsing nightmare. You could not differentiate when it means to increment and when to assign. For example:
Should var be var + 1, or should it be assigned to +1?
Code: Select all
var=+1
Re: How exactly does a local variable gets increased?
Code: Select all
<onLoad>
player.free_counter1 = 0;
function Return()
printf("Counter: "..player.free_counter1.."\n");
if player.free_counter1 > 2 then
printf("Done our rounds, loading new waypoints..."\n");
loadPaths("DragonFang/FromDragonFang");
else
player.free_counter1 = player.free_counter1 +1;
end
end
settings.profile.options.WAYPOINT_DEVIATION = 50;
</onLoad>
Botje
Re: How exactly does a local variable gets increased?
Code: Select all
printf("Done our rounds, loading new waypoints..."\n");
- 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.
- How to: copy and paste in micromacro
________________________
Quote:- “They say hard work never hurt anybody, but I figure, why take the chance.”
- Ronald Reagan
Re: How exactly does a local variable gets increased?
ooooh, that extra " ? xd
damn it
Botje
damn it
Botje
Who is online
Users browsing this forum: Google [Bot] and 1 guest