View Full Version : help with script, am noobie ;p
doeplidoep
06-20-2016, 12:24 PM
program CutDiamonds;
{$i SRL-6/SRL.simba}
Procedure DiamondCutter
var
x, y: Integer;
begin
if FindColorTolerance(x, y, 2968687,288, 137,300, 175, 10) then
begin
MoveMouse(x,y);
wait(500)
ClickMouse(x, y, mouse_Left)
end;
end;
begin
MouseSpeed := 15;
SetupSRL-6();
CutDiamonds
end.
soo that's what I got, whenever I try to play the script I get a error at: ClickMouse(x, y, mouse_Left)
I am just trying to make it so the script will click on a npc so I can lateron tell it to buy items and so on.
Appriciate the help :)
PS trying to make it for a RSPS called pkhonor, and thanks in advance for reading.
Joopi
06-20-2016, 12:35 PM
You need to add a ; after wait(500).
You also need to add a ; after ClickMouse(...).
also why are you trying to subtract 6 from SetupSRL :cartman:
EDIT: just realized you are probably thinking its srl6. Iirc its just SetupSRL;
doeplidoep
06-20-2016, 01:00 PM
okay I did that and I dont get anymore errors (thanks btw) but now when I target the RSPS and press play I get this message:
-- setupSRL()
---- Setting up SRL...
---- HINT: You are not using SMART, be sure to use Simba's crosshairs to select the RS client.
---- Waiting up to 5 minutes for RS to load...
and than nothing happens..
sorry for newbie questuons, still trying to get into it:)
Along with what joopi's said ^ you're also calling CutDiamonds on line 17, but your procedure is called DiamondCutter (with no "CutDiamonds" in sight) so you should be calling that. (& it'll need a semi colon after it)
You should read this scripting guide to quickly get a much stronger scripting base before continuing https://villavu.com/forum/showthread.php?t=58935, primarily this bit (http://i.imgur.com/2eiHieJ.png).
After that, you should check out this thread https://villavu.com/forum/showthread.php?t=94909&highlight=, if you do end up doing this, please do let us know how it goes =)
okay I did that and I dont get anymore errors (thanks btw) but now when I target the RSPS and press play I get this message:
-- setupSRL()
---- Setting up SRL...
---- HINT: You are not using SMART, be sure to use Simba's crosshairs to select the RS client.
---- Waiting up to 5 minutes for RS to load...
and than nothing happens..
sorry for newbie questuons, still trying to get into it:)
srl6 only detects rs3, from rj's guide: "a lot of the srl include will be unusable for the private server you want to bot on." & "First off we always want to include SRL just so we can use mmouse"
Starfox
06-27-2016, 02:30 AM
Hello Doeplidoep,
I use identifiers (i think their called) for mouse clicks:
0 = Right click
1 = Left click
2 = Scroll button click
So it would look like ClickMouse(X, Y, 0); for a right click on points X, Y.
Not 100% if this is the answer to your problem, but it is a nice tip to know.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Now for loading an RSPS client with srl-6, without overriding the ready procedure, you get this error:
-- setupSRL()
---- Setting up SRL...
---- HINT: You are not using SMART, be sure to use Simba's crosshairs to select the RS client.
---- Waiting up to 5 minutes for RS to load...
and than nothing happens..
Simply put this override function at the top of your script to ready the client automatically:
//srl-6 override function
function waitClientReady(): boolean;override;begin result:= true;end
Also I saw at the end, "SetupSRL-6();" 99% sure this is not the proper function to use.
Use SetupSRL();
Always remember your semicolons, and code structure.
I suggest reading up on a few more tutorials that can be found in the tutorials section.
After editing your code, this is what I have:
program CutDiamonds;
{$i SRL-6/SRL.simba}
var
x, y:Integer;
color:= 2968687;
const
bounds:= IntToBox(288, 137, 300, 175);
//srl-6 override function
function waitClientReady(): boolean;override;begin result:= true;end
procedure DiamondCutter;
begin
if FindColorTolerance(x, y, color, bounds, 10) then
begin
MoveMouse(x, y);
Wait(500 + Random(51));
ClickMouse(x, y, 1);
end;
end;
begin
MouseSpeed:= 15;
SetupSRL();
CutDiamonds;
end.
If you have any more questions, feel free to ask.
- Starfox
Powered by vBulletin® Version 4.2.1 Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.