SRL Archive - First Scripts

Normal Tree Power Cutter


mikevskater

2008-01-30 21:49:47

This is my first script, so there are bugs/errors, so if you find one point it out to me/ help me solve? BIG shout out to JAD for his awesome tuts and advice. Thanks go out to Pwnaz0r, Timer, and richk1693 for their help in my error solving and what not. So please enjoy, and post proggys if it works. (If not please tell me what happens, and how to fix it if you know in case I don't ;P)
~Mikevskater

Instructions:
1. Have rs on low detail.
2. Start with axe equipped and by a bunch of trees.
3. Post proggys when its done :)
Version 3.5 Released!

{/////|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||\\\\\
/////|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||\\\\\
|||||/ \|||||
||||| PowerCutter Ver 3.5 Mikevskater |||||
||||| This ver only cuts normal, oak, and willows |||||
||||| BIG Shout Out to JAD for his great tuts and advice! |||||
||||| Thanks ALOT to pwnaz0r for fixing my cut procedure! |||||
||||| Also big thanks to Timer, as well as richk1693 for all their help |||||
|||||\ Start by a bunch of trees with axe equppied /|||||
\\\\\|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||/////
\\\\\|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||/////
}
program FirstScript;
{.include srl/srl.scar}
{.include srl/srl/skill/woodcutting.scar}

var
x, y, Logs, Clicks, TreeColor, xp: Integer;
TreeName, Log: String;

const
Treetype = 'Willow';//Valid Trees are Tree, Oak, and Willow. More to come later.

////////////////////////////////////////////////////////////////////////////////
procedure DeclarePlayers;
begin
SRLID := ''; //enter or script will terminate
SRLPassword := ''; //register at srl please if dont have one of these!
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

Players[0].Name := 'Username';//Enter username
Players[0].Pass := 'Password';//Enter password
Players[0].Nick := 'Nick'; //Enter nickname
Players[0].Active := True;
end;
////////////////////////////////////////////////////////////////////////////////
procedure Anti;
begin
FindNormalRandoms;
if FindFight then
RunAway('N', True, 1, 9000+random(1000));
end;
////////////////////////////////////////////////////////////////////////////////
procedure Antiban;
begin
case random(20) of
0,3,6: BoredHuman;
4,7,10: RandomMovement;
8,11,14: PickUpMouse;
12,15,18: HoverSkill('woodcutting', false);
16,19: begin
Gametab(random(13+1));
wait(random(1000)+random(500));
Gametab(random(13+1));
wait(random(1000)+random(500));
Gametab(random(13+1));
wait(random(1000)+random(500));
gametab(4);
end;
end;
end;
////////////////////////////////////////////////////////////////////////////////
Function FindAxeIn: Boolean;
var
axe: Integer;
begin
axe := DTMFromString('78DA63E4626060E067400175F17C609A11CA6' +
'7640312720C688011550D0B909025A0860748B01050230E245809' +
'A81105127C04D480E439F1AB01004CBC01C4');
Gametab(5);
wait(1000);
If finddtm(axe, x, y, MIX1, MIY1, MIX2, MIY2) then
begin
Writeln('Axe Found');
result := true;
exit;
end;
Gametab(4);
wait(1000);
If finddtm(axe, x, y, MIX1, MIY1, MIX2, MIY2) then
begin
Writeln('Axe Found');
result := true;
end;
freedtm(axe);
end;
////////////////////////////////////////////////////////////////////////////////
Procedure CheckForBrokenAxe;
var
x, y, BrokenAxe: Integer;
begin
BrokenAxe := DTMFromString('78DA636C616260E0636440061D697C601A26C' +
'AD80354C38FAA06260B57D30754C34D404D2F508D080135CD4035' +
'5C04D4D400D5A8E05703008C0604B4');
Gametab(4);
wait(1000);
if finddtm(BrokenAxe, x, y, MIX1, MIY1, MIX2, MIY2) then
Logout;
freedtm(BrokenAxe);
end;
////////////////////////////////////////////////////////////////////////////////
procedure Cut;
var
Inv, z: Integer;
begin
repeat
CheckForBrokenAxe;
if FindColorTolerance(x , y, treecolor, MSX1, MSY1, MSX2, MSY2, 15) then
begin
mmouse(x,y,0,0);
wait(500);
if isuptext(treename) and not(findent(x, y, true)) then
begin
Inv := InvCount;
Mouse(x, y, 0, 0, True);
z := 0;
FFlag(0);
Clicks := Clicks + 1
ReportVars[1] := ReportVars[1] + 1;
Anti;
repeat
wait(250+random(250));
z := z+1;
Anti;
until(InvCount > Inv) or (z > 100) or InvFull;
Anti;
end;
end;
until(InvFull);
end;
////////////////////////////////////////////////////////////////////////////////
Procedure Drop;// By Timer150
var
i: Integer;
ItemPoint: TPoint;
begin
GameTab(4);
Wait(500 + Random(500));
for i := 1 to 28 do
if (ExistsItem(i)) then
begin
ItemPoint := ItemCoords(i);
MMouse(ItemPoint.x, ItemPoint.y, 5, 5);
Wait(250 + Random(60));
if IsUpText(Log) then
begin
Mouse(ItemPoint.x, ItemPoint.y, 5, 5, False);
Wait(250 + Random(50));
ChooseOption('rop');
logs := logs + 1;
ReportVars[0] := ReportVars[0] + 1;
case Treename of
'ree': begin
xp := xp + 25;
ReportVars[2] := ReportVars[2] + 25;
end;
'ak': begin
xp := xp + 37;
ReportVars[2] := ReportVars[2] + 37;
end;
'illow': begin
xp := xp + 67;
ReportVars[2] := ReportVars[2] + 67;
end;
end;
end;
end;
ArrangeInv;
end;
////////////////////////////////////////////////////////////////////////////////
procedure Proggy;
begin
ClearDebug;
Writeln('/-----------------------------------\');
Writeln('| PowerCutter by MikeVSkater |');
Writeln('\-----------------------------------/');
Writeln('/-----------------------------------\');
writeln('Clicks: ' + inttostr(clicks));
Writeln('Logs: ' + inttostr(logs));
Writeln('Time: ' + TimeRunning);
Writeln('Xp Gaind: ' + inttostr(xp));
Writeln('\-----------------------------------/');
end;
////////////////////////////////////////////////////////////////////////////////
procedure Signature;
begin
ClearDebug;
Writeln('PowerCutter made by Mikevskater');
wait(1000);
Writeln('This is my first script so please help me '+
'on anything you know that I dont?');
Wait(5000+random(1000))
end;
////////////////////////////////////////////////////////////////////////////////
procedure Setup;
begin
case LowerCase(TreeType) of
'Tree': begin
TreeColor := 1190181;
TreeName := 'ree';
Log := 'og';
end;
'Oak': begin
TreeColor := 2317131;
TreeName := 'ak';
Log := 'ak log';
end;
'Willow': begin
TreeColor := 5078394;
TreeName := 'illow';
Log := 'illow log';
end;
end;
end;
////////////////////////////////////////////////////////////////////////////////
begin
SetupSRL;
ScriptID := '599';
Setup;
DeclarePlayers;
Signature;
If SRLID = '' then
begin
ClearDebug;
Writeln('Register at SRL now and stop Leech`n');
Writeln('Please go to : http://www.srl-forums.com/forum/register.php');
TerminateScript;
end;
wait(100 + Random(500));
ActivateClient;
Writeln('Found RuneScape');
Wait(500 + random(50));
If (not Loggedin) then
LoginPlayer;
SetAngle(True);
MakeCompass('N');
wait(2000);
FindAxeIn;
{if FindAxein = false then
begin
Writeln('Axe not found');
Logout;
TerminateScript;
end;}
repeat
Cut;
AntiBan;
Anti;
Drop;
Anti;
AntiBan;
Proggy;
SRLRandomsReport;
until(False)
end.


Versions:

ver 1
First Script, probably errors in it, but has basic click, and a pretty good drop from Timer, and also has anti-ban, as well as anti-random.

ver 1.1
Fixed the report vars to actually report them…

ver 2
Now has multi tree, as well as better anti-ban.

ver 3
Just fixed up the script and added a more advanced look/procedures to script.

ver 3.5
Added find axe function in beginning of script.

Next Version
Probably more trees to cut, Don't know what else to add, anyone have an idea?

Best Proggy:

By: pyroryan
/-----------------------------------\
| PowerCutter by MikeVSkater |
\-----------------------------------/
/-----------------------------------\
Clicks: 56
Logs: 55
Time: 11 Minutes and 2 Seconds
\-----------------------------------/
^Come on guys, you can do better then that….

mikevskater

2008-02-01 14:45:48

Ok, 5 people have dl'ed it but still not a single post? Whats up with that?

Re-uploaded because I set up the report vars wrong…

FagetHax0r

2008-02-01 15:08:52

I Whas about to start

You script when i got this error when i did run



Line 142: [Error] (12409:9): Unknown identifier 'findFindRS' in script C:\Documents and Settings\Loes\Local Settings\Temporary Internet Files\Content.IE5\IPTWY3N1\FirstPowerCutterver1.1[1].scar

mikevskater

2008-02-01 15:18:09

From: FagetHax0r
I Whas about to start

You script when i got this error when i did run



Line 142: [Error] (12409:9): Unknown identifier 'findFindRS' in script C:\Documents and Settings\Loes\Local Settings\Temporary Internet Files\Content.IE5\IPTWY3N1\FirstPowerCutterver1.1[1].scar

yeah, I saw that, I was just about to re-upload but you beat me to it… i think srl removed findrs too…. because it gives me that error every time i try to run(without the spelling error lmao) re-uploaded, fixed again

mikevskater

2008-02-02 16:53:20

Version 2 Released! Reposted in scar tags.

JAD

2008-02-02 18:02:33

Good job. Nice to see you moving along with your scripting abilities! :)

Improvements:

SRLID and SRLPassword are usually, and I think supposed to be, with the constants. I'd move them to there, even though I'm not 100% sure you have to.

FindNormalRandoms should be FindNormalRandoms;. Even though it's not needed, it's best to start good habits not :)

I don't think there's a need and I think the script would work better (I could be wrong though) if you didn't have all that waiting in your anti ban.

After finding the tree and moving the mouse to it using findobj, the script will move the mouse some more (random 5,5 parameters) and then click. This is bad, because you were already on the tree, and the script may move the mouse off the tree, and it just makes you look less human. Try using (after findobj) GetMousePos(x,y) and use Mouse(x,y,0,0,true); after that.

I hate the FindObj function, a lot of people use it, but there are a lot more reliable ways to find colors that aren't even that advanced you could use to find the color instead. Try learning some other techniques other than FindObj for finding colors to make the script more reliable/advanced.

If you have the until(InvFull);, you don't need if(InvFull)than break; or vise versa. :)

For the setup procedure, you could really clean up the code a lot by using a case. Try learning case of statements (Learning the things it takes to become a srl member (links in sig) :))

There's no point to disguising scar really, but there's no problem in doing it I guess. I don't know why it bugs me when people do :p


If (not Loggedin) then
begin
Loginplayer;
end;

could be


If (not Loggedin) then
Loginplayer;

No need for a begin/end after an if/then if you're only doing 1 command after it.

Back to the cut procedure:


wait(50+random(25));
z := z+1;
Anti;

That might lag like hell. You may want to add just a little bit more waiting to that :)

Change your anti ban so it doesn't only do it in your main loop after your done chopping if it does it at all. If you take out the waiting in your anti ban, and add a bigger random to your case, you can put it in the loop I specified above that I said you should add more waiting too. Just make sure if you add it to that, make the random a LOT bigger so it's not doing anti ban every 5 seconds…

There's many more anti ban functions in srl, and you could make your own using MouseBox or something, or random chat…etc. Try making more anti ban things to add to the 4 you use already.


Good script though, just learn some more advanced techniques for finding colors, change the things (or at least more of the things) I specified and this script is well on it's way to being worthy of members.

Good luck!

~JAD

P.S. this is a very detailed report, so don't think it's a bad script :) I just pointed out every single little thing I saw so you could improve it.

mikevskater

2008-02-02 18:23:09

Thanks so much JAD im working on it right now and ill hit you up when i finish it :)

Heavenzeyez1

2008-02-03 06:19:54

You can check out my powercutter, and see, if you can find anything new. :)
Eerik.

mikevskater

2008-02-03 09:19:02

From: heavenzeyez1
You can check out my powercutter, and see, if you can find anything new. :)
Eerik.

thanks i'll check it outT :)

FagetHax0r

2008-02-03 09:39:01

Im gonna powercut With my main He got 64 Wc and he need 70-75 So i gonna powerlevel some willows


And for the new version you should add Anti Random

mikevskater

2008-02-03 14:47:16

From: FagetHax0r
Im gonna powercut With my main He got 64 Wc and he need 70-75 So i gonna powerlevel some willows


And for the new version you should add Anti Random

It has an anti-random as well as a anti-ban…. just doesn't have fastrandoms is that what you mean?

BTW, 100+ views and still not 1 proggy!?!? come on…. just one is all i want to feel happy in the pants ;)

Waffles

2008-02-04 17:26:03

I got this error while running it:
[Runtime Error] : Exception: Access violation at address 0071FDA0 in module 'scar.exe'. Read of address FFFFFFFC in line 227 in script C:\Program Files\SCAR 3.14\includes\SRL/SRL/Core/Login.scar

I tried it twice and got the same type of error.
It logged in successfully, and right when it finished clickign "Click here to Play" it came up.
If it helps, I was trying to use normal logs.

I hope this isn't a problem on my side >_<.

mikevskater

2008-02-04 20:43:49

From: Waffles
I got this error while running it:
[Runtime Error] : Exception: Access violation at address 0071FDA0 in module 'scar.exe'. Read of address FFFFFFFC in line 227 in script C:\Program Files\SCAR 3.14\includes\SRL/SRL/Core/Login.scar

I tried it twice and got the same type of error.
It logged in successfully, and right when it finished clickign "Click here to Play" it came up.
If it helps, I was trying to use normal logs.

I hope this isn't a problem on my side >_<.

Umm… sadley it is… ive never gotten that error… ill check it out and post awnser hold on
Btw. Thanks for using my script

Edit: Sorry I can't find a solution….. anyone know how to fix?

meoth

2008-02-05 06:02:09

I don't know whats going on, this script gives me an access violation and freezes up scar. It may be my laptop though, very old and doesn't support any resolutions over 740. When i try my other laptop i'll be sure to edit and report back.

mikevskater

2008-02-05 18:03:20

From: meoth
I don't know whats going on, this script gives me an access violation and freezes up scar. It may be my laptop though, very old and doesn't support any resolutions over 740. When i try my other laptop i'll be sure to edit and report back.

Is it the same error as waffle's? if so ill re post script with ver 2.5 even though its notcomplete

Waffles

2008-02-05 18:41:30

From: mikevskater
Is it the same error as waffle's? if so ill re post script with ver 2.5 even though its notcomplete


Mine only froze up for about 5-10 seconds though.

mikevskater

2008-02-05 21:16:39

From: Waffles
Mine only froze up for about 5-10 seconds though.

hmm….. i posted this on "Script Help" and someone tested and it compiled for them, so it must be something wrong with your scar, try reinstalling or re updating?

meoth

2008-02-06 04:34:19

Alright here is how i got it to work.

Tools > Options < SRL Download < Change it to "Regular Download" < Press "Ok"

Make sure you're using Scar 3.12b, if the following information doesn't help then please post back and i'll try to narrow it down some more. It works for me so far though. will have a proggy when i actually have time to test properly.

mikevskater

2008-02-06 15:18:45

From: meoth
Alright here is how i got it to work.

Tools > Options < SRL Download < Change it to "Regular Download" < Press "Ok"

Make sure you're using Scar 3.12b, if the following information doesn't help then please post back and i'll try to narrow it down some more. It works for me so far though. will have a proggy when i actually have time to test properly.

So your gonna test soon? Want to know if it works, so when you test just hit up the proggy. Thanks
~Mikevskater

meoth

2008-02-06 19:30:01

I logged out and started, it wouldn't click existing user. i clicked it myself. then it typed in my user/pass but didn't press login. it just repeated the process. I then logged in myself and tested from there.
/———————————–\
| PowerCutter by MikeVSkater |
\———————————–/
/———————————–\
Clicks: 15
Logs: 31
Time: 5 Minutes and 4 Seconds

Got a random while afk at that point, don't remember how it reacted.

Other then login it works well, i like it's movement. Looks very human like.

mikevskater

2008-02-06 21:06:08

From: meoth
I logged out and started, it wouldn't click existing user. i clicked it myself. then it typed in my user/pass but didn't press login. it just repeated the process. I then logged in myself and tested from there.
/———————————–\
| PowerCutter by MikeVSkater |
\———————————–/
/———————————–\
Clicks: 15
Logs: 31
Time: 5 Minutes and 4 Seconds

Got a random while afk at that point, don't remember how it reacted.

Other then login it works well, i like it's movement. Looks very human like.

hmm…. i dont know about the login…. but thanks for trying the script out, and i will hopefully post next ver by tomorow or saturday (busy at all that remains concert on friday so cant work on) I think the login error is all on your end, becuase its a srl procedure so idk… But THANKS for posting the first proggy

Edit: WOOT 2 pages :)

pyroryan

2008-02-07 02:57:24

/———————————–\
| PowerCutter by MikeVSkater |
\———————————–/
/———————————–\
Clicks: 56
Logs: 55
Time: 11 Minutes and 2 Seconds
\———————————–/

Works great, chooses a new tree quickly after chopping down one. I lowered the drop wait times because it was dropping too slow for my liking. Also, the randoms seem to give it a hard time, I've died twice from Ents. Overall very nice script, first WC I could get to work.

EDIT: I keep getting this problem, and it's only with this script-

Found a box, solving…
Question is:
Which shape has number 3
Answer is Square
******** SOLVED BOX RANDOM ********
[Runtime Error] : Exception: Access violation at address 0071FDA0 in module 'scar.exe'. Read of address FFFFFFFC in line 253 in script C:\Program Files\SCAR 3.14\includes\SRL/SRL/Core/AntiRandoms/Box.scar

mikevskater

2008-02-07 11:47:34

From: pyroryan
/———————————–\
| PowerCutter by MikeVSkater |
\———————————–/
/———————————–\
Clicks: 56
Logs: 55
Time: 11 Minutes and 2 Seconds
\———————————–/

Works great, chooses a new tree quickly after chopping down one. I lowered the drop wait times because it was dropping too slow for my liking. Also, the randoms seem to give it a hard time, I've died twice from Ents. Overall very nice script, first WC I could get to work.

EDIT: I keep getting this problem, and it's only with this script-

Found a box, solving…
Question is:
Which shape has number 3
Answer is Square
******** SOLVED BOX RANDOM ********
[Runtime Error] : Exception: Access violation at address 0071FDA0 in module 'scar.exe'. Read of address FFFFFFFC in line 253 in script C:\Program Files\SCAR 3.14\includes\SRL/SRL/Core/AntiRandoms/Box.scar


Thanks im glad you liked my script :) (that makes me a lil happy in the pants :p naw jk) but yah, i need to make a better anti-random in next ver, as well as fix up the drop procedure. Idk about that box error… umm, ill ask someone to take a look… Thanks again for usin my script
~Mikevskater

Edit: I got that same login thing as well…. this rev got a bug?!?!

tb71290bt

2008-02-07 17:05:50

after i run it it says

PowerCutter made by Mikevskater
This is my first script so please help me on anything you know that I dont?
Found RuneScape
[Runtime Error] : Math error in line 200 in script C:\Program Files\SCAR 3.12\includes\SRL/SRL/Core/Login.scar

then says it has finished

mikevskater

2008-02-07 17:11:23

From: tb71290bt
after i run it it says

PowerCutter made by Mikevskater
This is my first script so please help me on anything you know that I dont?
Found RuneScape
[Runtime Error] : Math error in line 200 in script C:\Program Files\SCAR 3.12\includes\SRL/SRL/Core/Login.scar

then says it has finished

hmm… im looking at the include… and it when it looks for the click here to play button…. idk try restarting?

mikevskater

2008-02-14 21:49:44

Ver 3 Released!!!!
Re-uploaded/posted on first page.

bobo1172

2008-02-15 20:07:17

this looks pretty cool!!!!!!!!!!!
where can i find newbie scripting tuts?

mikevskater

2008-02-16 12:16:35

From: bobo1172
this looks pretty cool!!!!!!!!!!!
where can i find newbie scripting tuts?

please try to control your spamming…..
but just because im in a good mood today, read JAD's tuts, there what helped me the most:
http://www.villavu.com/forum/showthread.php?t=6366
http://www.villavu.com/forum/showthread.php?t=9377


To everyone else, please try my new version! I want to know if its any better

donbogan

2008-02-16 20:03:50

Thanks for this script I finally got it working.

dusty

2008-02-16 22:33:35

do i jsut downlaod it or do i ahve to change somethign bc most bots you ahve to change somethign waht do i do?

mikevskater

2008-02-18 20:23:33

From: dusty
do i jsut downlaod it or do i ahve to change somethign bc most bots you ahve to change somethign waht do i do?

You can jusst copy and paste the code on the first page (code in the box) and then you need to fill in the player's conts:
procedure DeclarePlayers;
begin
SRLID := '{Enter SRL Id}'; //enter or script will terminate
SRLPassword := '{Enter SRL pass}'; //register at srl please if dont have one of these!
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

Players[0].Name := 'UserName';//Enter username
Players[0].Pass := 'PassWord';//Enter password
Players[0].Nick := 'NickName'; //Enter nickname
Players[0].Active := True;
end;
just fill those out and then target rs, and press play

mikevskater

2008-02-19 23:25:55

Ok… I would really appriciate some Junior/Member assistance here…. For a anti-ent finder… would i just do like

if findcolortolerance([ent word color],x,y,x2,y2) then
break;
If someone could post a tut that includes this or could help me out that would be awsome!

mikevskater

2008-02-22 16:56:25

Ver 3.5 is out!
Re-edited in scar tags, and uploaded as well.
come on post them proggys and beat the on under script!

Zertar

2008-02-29 05:59:58

Well I downloaded and tried it. I am currently using an Iron axe to chop trees and when I start it up it searches through my inventory and equipment screens then logs off saying cannot find axe. I started with the axe equiped, then tried again with it in inventory. Do I need a certain type of axe to make this script work??

mikevskater

2008-03-02 21:29:27

From: Zertar
Well I downloaded and tried it. I am currently using an Iron axe to chop trees and when I start it up it searches through my inventory and equipment screens then logs off saying cannot find axe. I started with the axe equiped, then tried again with it in inventory. Do I need a certain type of axe to make this script work??

ohh yeah im sorry about ath… that ver had a bug with the axe finder…, just quote the find axe line in main loop, here ill re edit tags on main page.
I have fix in next ver(almost done) but i will be posting on srl-junior members section. Anyone have any proggys?