Log in

View Full Version : Script Compiling, but still need fixes



TheGodfather
02-11-2007, 11:22 PM
Hey, I've made the basic mine rocks part of my script, (no anti-randoms yet, but I have the code for them but haven't added it, and haven't added the drop procedure in, but I got all of that no worries :P)


program PowerMiner;
{.include SRL/SRL.scar}

//~Basic Functions of the Godfather Inc. Power Miner VERS. Alpha~
//IMPORTANT:= low detailed 32 bit colors
//Have mouse over rock desired to mine within 10 seconds of starting script
//Rimmington Rocks NOT reccomended~
//Report bugs/glitches to dub_edit@yahoo.com
//Known Glitches: No Anti Randoms (will come in beta)
{============Updates Expected============)
~Use some SRL includes
~Anti Randoms in Beta Version
~A progress report
}
{----------BeginOfSetup----------}
const
nextrock= 2800; //Miliseconds till begin mining next rock? (1000 = 1 second)
// Press CTRL+ALT+S to stop script
{----------end of setup----------}
var full,rockmined,xR,yR,x1,y1,x2,y2: integer;
procedure GetSRL;
begin
setupsrl;
MouseSpeed:= 8;
end;
procedure LoadBitmap;
begin
full := BitmapFromString(16, 12, 'z78DA73B27434B5' +
'307442220D908013862C0AE9E8E864E14880C43019934D020 9361' +
'3C5854822C8F692693EA66BF19B86D7BF44998F2B344834CD 096F' +
'3C620262621C7F4A202A7C70F89754712A9B8FE1E6C1EF7E5 CB14' +
'36A6EC29F129C8C2C2DCD4D212401F391546211C7EF122435 0043' +
'29FB94');
end;

// AutoColor.....
Function GetRockColor(rockmined: integer): integer;
begin
wait(10000)
GetMousePos(x1,y1);
rockmined:= GetColor(x1,y1);
Result:= Getcolor(x1,y1);
end;

//Mining Routine *********************** By TheGodfather
Procedure MineRock;
begin
FindColorTolerance(xR,yR,rockmined,30,20,485,315,2 );
Mouse(xR,yR,4,4,true)
wait(nextrock)
end;
begin
repeat MineRock;
until(findbitmap(full,x2,y2))
end.

What I believe needs fixing in the script is the Function GetRockColor, as Im not 100% sure I got the result back. If someone can, I'd like some help please. Thanks.
If the auto color is a hard thing to use, then I'd just get the color as a constant, and make a better auto color.

Heres the script with a constant

program PowerMiner;
{.include SRL/SRL.scar}

//~Basic Functions of the Godfather Inc. Power Miner VERS. Alpha~
//IMPORTANT:= low detailed 32 bit colors
//Have mouse over rock desired to mine within 10 seconds of starting script
//Rimmington Rocks NOT reccomended~
//Report bugs/glitches to dub_edit@yahoo.com
//Known Glitches: No Anti Randoms (will come in beta)
{============Updates Expected============)
~Use some SRL includes
~Anti Randoms in Beta Version
~AntiBan
~A progress report
~Auto Color
}
{----------BeginOfSetup----------}
const
nextrock= 2800; //Miliseconds till begin mining next rock? (1000 = 1 second)
rockmined= 2503250; //color of rock mining
// Press CTRL+ALT+S to stop script
{----------end of setup----------}
var full,xR,yR,x1,y1: integer;
procedure GetSRL;
begin
setupsrl;
MouseSpeed:= 12;
end;
procedure LoadBitmap;
begin
full := BitmapFromString(16, 12, 'z78DA73B27434B5' +
'307442220D908013862C0AE9E8E864E14880C43019934D020 9361' +
'3C5854822C8F692693EA66BF19B86D7BF44998F2B344834CD 096F' +
'3C620262621C7F4A202A7C70F89754712A9B8FE1E6C1EF7E5 CB14' +
'36A6EC29F129C8C2C2DCD4D212401F391546211C7EF122435 0043' +
'29FB94');
end;

//Mining Routine *********************** By TheGodfather
Procedure MineRock;
begin
FindColorTolerance(xR,yR,rockmined,30,20,485,315,2 );
Mouse(xR,yR,4,4,true);
wait(nextrock)
end;
begin
repeat MineRock;
until(findbitmap(full,x1,y1))
end.

The Problem is the mouse just goes over to the rock and then the script just executes. And I get a runtime error

Mjordan
02-12-2007, 12:41 AM
well your standards are very bad. you should skip at least one line between procedures,functions,main loop, etc. check out the post on kaitnieks that tells all the standards. in your main loop put MineRock on the next line after repeat. and also this is not necessary, but i suggest putting this
//~Basic Functions of the Godfather Inc. Power Miner VERS. Alpha~
//IMPORTANT:= low detailed 32 bit colors
//Have mouse over rock desired to mine within 10 seconds of starting script
//Rimmington Rocks NOT reccomended~
//Report bugs/glitches to dub_edit@yahoo.com
//Known Glitches: No Anti Randoms (will come in beta)
{============Updates Expected============)
~Use some SRL includes
~Anti Randoms in Beta Version
~A progress report
}


before this

program PowerMiner;
{.include SRL/SRL.scar}

so heres the script that uses the const, cleaned up a lil for you. just look i added and changed some lil things here and there. run it, it might work now ;)

//~Basic Functions of the Godfather Inc. Power Miner VERS. Alpha~
//IMPORTANT:= low detailed 32 bit colors
//Have mouse over rock desired to mine within 10 seconds of starting script
//Rimmington Rocks NOT reccomended~
//Report bugs/glitches to dub_edit@yahoo.com
//Known Glitches: No Anti Randoms (will come in beta)
{============Updates Expected============)
~Use some SRL includes
~Anti Randoms in Beta Version
~AntiBan
~A progress report
~Auto Color}

program PowerMiner;
{.include SRL/SRL.scar}

var full, xR, yR, x1, y1: integer;

{----------BeginOfSetup----------}
const
nextrock = 2800; //Miliseconds till begin mining next rock? (1000 = 1 second)
rockmined = 2503250; //color of rock mining
// Press CTRL+ALT+S to stop script
{----------end of setup----------}

procedure GetSRL;
begin
setupsrl;
MouseSpeed := 12;
end;

//Loads BitMaps

procedure LoadBitmap;
begin
full := BitmapFromString(16, 12, 'z78DA73B27434B5' +
'307442220D908013862C0AE9E8E864E14880C43019934D020 9361' +
'3C5854822C8F692693EA66BF19B86D7BF44998F2B344834CD 096F' +
'3C620262621C7F4A202A7C70F89754712A9B8FE1E6C1EF7E5 CB14' +
'36A6EC29F129C8C2C2DCD4D212401F391546211C7EF122435 0043' +
'29FB94');
end;

//Mining Routine *********************** By TheGodfather

procedure MineRock;
begin
FindColorTolerance(xR, yR, rockmined, 30, 20, 485, 315, 2);
Mouse(xR, yR, 4, 4, true);
wait(nextrock)
end;

//Main Loop
begin
ActivateClient;
GetSRL;
LoadBitmap;
repeat
MineRock;
until (findbitmap(full, x1, y1))
end.

TheGodfather
02-12-2007, 12:53 AM
Alright, I LOVE YOU MAN!! ++REP Mjordan ;)
You made my day man. Dont rubb in my retarded question xD :P

Mjordan
02-12-2007, 12:55 AM
Alright, I LOVE YOU MAN!! ++REP Mjordan ;)
You made my day man. Dont rubb in my retarded question xD :P

hey np dude, and thanks. does it do what you want to now?

TheGodfather
02-12-2007, 01:11 AM
Not yet, but I know whats up with it now, now my problem is it only clicks on one rock, and stops. But I'll try to fix it all teh ways I kno how. If i dont ill ask for more help.

Mjordan
02-12-2007, 01:19 AM
Not yet, but I know whats up with it now, now my problem is it only clicks on one rock, and stops. But I'll try to fix it all teh ways I kno how. If i dont ill ask for more help.

ok saounds good, and ill try and help :)

immacutyew
02-12-2007, 01:30 AM
SOMEONE PLEASE TELL ME HOW TO DOWNLOAD SRL, email me at pansyunicorn@yahoo.com or post here please i beg of you!!

Mjordan
02-12-2007, 01:42 AM
SOMEONE PLEASE TELL ME HOW TO DOWNLOAD SRL, email me at pansyunicorn@yahoo.com or post here please i beg of you!!

ROFL! dude no thread stealing, and if you can read whatsoever then you could find where and how to download it.....

immacutyew
02-12-2007, 01:53 AM
i did read, but when i go to the the "download srl here..." thread it doesn't have anywhere to download it just has these 2 attached files on the right side that say...like download srl with manual and another that says same except without manual, i really need help, if you could im me on aim it would really help me it's my first day, my aim is: pimpest122003

Mjordan
02-12-2007, 02:03 AM
ummm lol then why dont you try downloading the attachment there pedro?

TheGodfather
02-12-2007, 02:04 AM
haha

immacutyew
02-12-2007, 02:06 AM
i did...but it just takes me into scar when i open it...

TheGodfather
02-12-2007, 02:07 AM
SOMEONE PLEASE TELL ME HOW TO DOWNLOAD SRL, email me at pansyunicorn@yahoo.com or post here please i beg of you!!

Well please excuse me for the double post, but when you join communities as such (like these) you shouldnt act all new. Right now it looks as if you only Joined the SRL forums to leech. Leechers aren't very appreciated.

immacutyew
02-12-2007, 02:07 AM
also i get the message when i try to rune g0f yewcutter thingy it says:

Include file C:\Program Files\SCAR113\Scripts\SRL/SRL.scar does not exist.
Include file C:\Program Files\SCAR113\Scripts\SRL/SRL/skill/woodcutting.scar does not exist.
Include file C:\Program Files\SCAR113\Scripts\SRL\SRL\Extended\xBank.scar does not exist.
Failed when compiling
Line 57: [Error] (57:1): Unknown identifier 'HowManyPlayers' in script C:\Program Files\SCAR113\Scripts\GoF - YewBlaster.scar

immacutyew
02-12-2007, 02:08 AM
i don't even know what a leecher is -.-

Mjordan
02-12-2007, 02:10 AM
i don't even know what a leecher is -.-

well take a look at yourself and you'll figure out what one is.