iirickyii Posted March 16, 2013 Share Posted March 16, 2013 Hi, this is my first script ever made, never had any experience scripting or programming at all, I followed an example my buddy made and this script is supposed to just spam click master farmers in draynor village in rs07 and i want that to work before i start learning how to add banking, eating when low, and stuff like that so if anyone could help me with thanks very much appreciated! im noob Program autoThiever; //Version 1.0 var x,y:integer; Const masterFarmer = 3757402; //Color of Master Farmer masterFarmer2 = 2706778; //Color of Master Farmer Procedure clickThieve; //This is a function for clicking on the farmer begin if (FindColor(x, y, masterFarmer, 1, 1, 900, 900)) and (FindColor(x ,y, masterFarmer2, 1, 1,900, 900) = true) then //If find farmer, click on him movemouse(x, y); clickmouse(x, y, mbleft); end; Procedure Main; begin clickThieve; wait(3000); end; begin Repeat // Repeats for ever.. or until program is stopped. Main; Until False; //end of the repeat (must have false statement) end. all its doing is moving the mouse to the top left corner of the target selection (rs07 screen) and i paused it to check where in my script this keeps happening and its at the wait(3000); so if anyone could figure out why it just stays in the corner instead of trying to click the master farmer please post thank you ! Quote Link to comment Share on other sites More sharing options...
slacky Posted March 17, 2013 Share Posted March 17, 2013 (edited) You should consider using the SCAR-tag [*SCAR] (remove the star) when posting scar-code. Both colors you specified was not found, this caused the mouse to move to Point: (-1,-1). if FindColor(...) is not found, the x,y returned is = (-1,-1) Q:Why wasn't the color found? A: Well it's simply because colors change in runescape, that's why we use: FindColorTol inseatd of FindColor. Q: But why did the mouse move to -1,-1 when the color wasnt found? A: The reason for that is that you did not use begin and end; for the "if-color found" block. thus casing the clickmouse(x, y, mbleft)-part to be done whether or not the color was found. Try this: [sCAR] Program autoThiever; //Version 1.0 const masterFarmer = 3757402; //Color of Master Farmer masterFarmer2 = 2706778; //Color of Master Farmer //This is a function for clicking on the farmer procedure clickThieve; var x,y:integer; begin //If find farmer, click on hi if (FindColorTol(x, y, masterFarmer, 0, 0, 765, 502,20)) AND (FindColorTol(x ,y, masterFarmer2, 0, 0, 765, 502,20)) then begin movemouse(x, y); clickmouse(x, y, mbleft); end; end; Procedure Main; begin clickThieve; wait(3000); end; begin repeat // Repeats for ever.. or until program is stopped. Main; until False; //end of the repeat (must have false statement) end. [/sCAR] You might consider using "OR" in the if-statement: "if FindColorTol(..) OR FindColorTol(..) then...". Else, great work man! Edited March 17, 2013 by slacky Quote Link to comment Share on other sites More sharing options...
iirickyii Posted March 17, 2013 Author Share Posted March 17, 2013 still doing the same exact thing except the mouse is going to a different location not too far though just a bit to the right, still at the top >.> im stuck on what to do Quote Link to comment Share on other sites More sharing options...
Janilabo Posted March 17, 2013 Share Posted March 17, 2013 That means it is picking up similar colors from the screen. Are the coordinates always the same, or do they keep changing? This is why you really should use either OSI or MSSL, so you could check up things based on uptext. I have added introduction to MSSL's RuneScape 2007 related commands here: http://forums.scar-divi.com/showthread.php?2131-Intro-to-MSSL-s-RuneScape-2007-commands&highlight= Quote Link to comment Share on other sites More sharing options...
slacky Posted March 17, 2013 Share Posted March 17, 2013 (edited) Well, then I guess the color was found at that position (since the mouse did not bounce out of the RS-client-area), at worst, I did something wrong (I don't think so...). Try: - Decrese the tolerance, and grab a new set of colors. Tolerance is the very last parameter in FindColorTol(...); - Grab better colors, colors that is not anywhere else on the screen. Also, if you know that you're close to the farmer you can decrese the search area, EG: [sCAR] Program autoThiever; //Version 1.0 const masterFarmer = 3757402; //Color of Master Farmer masterFarmer2 = 2706778; //Color of Master Farmer //This is a function for clicking on the farmer procedure clickThieve; var x,y:integer; begin //If find farmer, click on hi if (FindColorTol(x, y, masterFarmer, 130, 70, 385, 265, 15)) AND (FindColorTol(x ,y, masterFarmer2, 130, 70, 385, 265, 15)) then begin movemouse(x, y); clickmouse(x, y, mbleft); end; end; Procedure Main; begin clickThieve; wait(3000); end; begin repeat // Repeats for ever.. or until program is stopped. Main; until False; //end of the repeat (must have false statement) end. [/sCAR] Also, the sugestion made by Janilabo.. Use MSSL RS07-lib to find uptext (the text up in the corner that usualy sais "Walk here")... It's a great tip!! Because when you hold your mouse over the farmer it would say "farmer something... /X more options...". RS07_IsUpText combined with a for loop, and FindColorTolEx is great! Edited March 17, 2013 by slacky Quote Link to comment Share on other sites More sharing options...
iirickyii Posted March 17, 2013 Author Share Posted March 17, 2013 That means it is picking up similar colors from the screen.Are the coordinates always the same, or do they keep changing? This is why you really should use either OSI or MSSL, so you could check up things based on uptext. I have added introduction to MSSL's RuneScape 2007 related commands here: http://forums.scar-divi.com/showthread.php?2131-Intro-to-MSSL-s-RuneScape-2007-commands&highlight= yes your correct after using slackys last updated version of my code it is now clicking things the same color as the master farmer like the gate and stall and such but still not clicking the farmer at least its not click the same spot over and over so im guessing i should try and choose different colors ? and yeah the coordinates are always changing if you mean the master farmer since he walks around and i'm not sure how those commands go so i could write a whole script using those commands? as i stated in my first post I have no experience at all in programming/coding/ etc.. but i'm very interested in learning and probably will understand how to set things up if i could get a source code of a simple bot to look at ? Quote Link to comment Share on other sites More sharing options...
slacky Posted March 17, 2013 Share Posted March 17, 2013 Take a look in the RS-botting section... Download some of the latest scripts from there. They are pretty simple to learn from Quote Link to comment Share on other sites More sharing options...
entorin Posted May 1, 2013 Share Posted May 1, 2013 I have a fishing script and I have it all set up i just don't know how to actually run it, like what button do i press to start the script up? Quote Link to comment Share on other sites More sharing options...