I'm only 13 and don't understand half the things I read from the tuts....
I'm only 13 and don't understand half the things I read from the tuts....
Add my msn, dynamite-boom@hotmail.co.uk
You can ask me all the nooby questions you need
-Boom
You're not allowed to quit once you start scripting. I will try to help you understand your script.
If you press run on simba it will start running the between the begin and end.(notice the point). So that is were I will start explaining.
Simba Code:begin
SetupSRL;
DeclarePlayers;
LoginPlayer;
Logs_Chopped := 0;
repeat
while (not(InvFull)) do
begin
FindTree;
//your wait function
end;
WalkToBank;
BankLogs;
WalkToTrees;
until (Logs_Chopped >= LOGS);
Logout;
end.
The following lines are used to set up the script. SetupSRL loads everything it needs and sets the mouse speeds. It's placed correctly at the beginning of the loop. DeclarePlayers will run the procedure were you entered your player information. This is used by LoginPlayer, so it should always be before LoginPlayer. You did this correctly.
LoginPlayer will fill in the form and logs you in. It is however a better practice to call it after a check if the player is already LoggedIn. Final code can be seen down here. Notice I didn't use a begin and end; there, If they aren't used only one line of code will be run after the if-statement.
Simba Code:SetupSRL;
DeclarePlayers;
if not(LoggedIn) then
LoginPlayer;
The next code you used is Logs_Chopped := 0;, this code isn't needed. If you declare(make) a variable of the type Integer(a number) it will start as 0. So it's already 0 here.
I hope I still got you here? Cause now it's getting interesting. I will explain the loops you use.
You start with a repeat loop. A repeat loop repeats everything between repeat and until(condition);. When it reaches the bottom it will go up again. Unless the condition after until is True. Then it will continue at the next line.
Another loop you used is the while loop. There are a few differences between them. One of those is that you don't need two line like repeat and until, but only one. So the same rules apply as with if statements. Only the line after then is run, unless it's a begin, in that case it will run everything between the begin and the end;.
One of your problems is in the while loop. Here is a possible situation:
- Is your InvFull?
- No it isn't.
- Click a tree.
- Is your InvFull?
- No it isn't.
- Click a tree.
- Is your InvFull?
- No it isn't.
- Click a tree.
This all happens within a second. That is the spam clicking you were talking about. You want to wait until the tree is down. This is the hardest part of writing a woodcutter. With a wait function it could look like this:
- Is your InvFull?
- No it isn't.
- Click a tree.
- Wait till tree is down.
- Is your InvFull?
- No it isn't.
- Click a tree.
- Wait till tree is down.
- Is your InvFull?
- Yes it is full.
- Walk to bank.
This will eliminate the spam clicking.
I will help you further tomorrow.
Working on: Tithe Farmer
Huthaifah pay close attention to what your fellow scripters are trying to teach you.
Faith is an oasis in the heart which will never be reached by the caravan of thinking.
There are currently 1 users browsing this thread. (0 members and 1 guests)