Oh. I guess I didn't notice that :O
Thanks for the advice and help. You've helped me finish my first script![]()
Oh. I guess I didn't notice that :O
Thanks for the advice and help. You've helped me finish my first script![]()
No trouble at all. Good luck!
Ciao
NM
"[Error] (55:1): Identifier expected at line 54
Compiling failed."
This happened when I tried to compile my script after adding a proggy system. If anyone can help me I can send the entire script so you can help me out.
Just post the procedure / function that line 54 is in.
Ciao
NM
procedure WalkBank;
You may contact me with any concerns you have.
Are you a victim of harassment? Please notify me or any other staff member.
| SRL Community Rules | SRL Live Help & Chat | Setting up Simba | F.A.Q's |
You may contact me with any concerns you have.
Are you a victim of harassment? Please notify me or any other staff member.
| SRL Community Rules | SRL Live Help & Chat | Setting up Simba | F.A.Q's |
Getting this when I try to compile my SwampToad Picker :
"[Error] (59:12): Unknown identifier 'x' at line 58
Compiling failed."
if FindObj(x, y, 'taircase', 396561, 3) then
That is the line it says that at.
You may contact me with any concerns you have.
Are you a victim of harassment? Please notify me or any other staff member.
| SRL Community Rules | SRL Live Help & Chat | Setting up Simba | F.A.Q's |
That worked and I forgot the ';' everytime after every procedure so it didn't compile until I figured it out.
Edit : Nvm. Fixed it up.
Last edited by Striken; 02-06-2012 at 01:21 AM.
what does tpointarray do? I was making a universal walkbank; procedure and i cant seem to get it to stick? any tips, dymamite?
Alright I gotta question ok so basically I want it to click the circled water source symbol
and I never want it to click the other one to the north so I would like some help on FindSymbolMulti and stuff like that
also one more question
how do I do like
if not findobj for 5000 then
basicaly I want it if it cant find a warrior for five seconds then have it click on the circled water source to find more of em
Last edited by poopy2177; 02-19-2012 at 09:11 PM.
My Soul Wars Scipt Proggress:[100%....]Probably won't release though I like it for myself
procedure Obstacle;
var x, y: integer;
begin
repeat
FindNormalRandoms;
WriteLn('Looking for obstacle net.');
if FindObj(x, y, 'bstacle net', 4084847, 10) then
WriteLn('Climbing Obstacle.');
Mouse(x, y, 0, 0, true);
If isUpText('limb-over') then
ChooseOption('limb-over');
end;
[Error] (34:1): Identifier expected at line 33
Compiling failed.
Line 33 is "end;"
Simba Code:function TrapDoorColor: Integer;
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
X, Y, Z: Extended;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.20, 0.35);
FindColorsSpiralTolerance(MSCX, MSCY, arP, 6186359, MSX1, MSY1, MSX2, MSY2, 24);
if (Length(arP) = 0) then
begin
Writeln('Failed to find the color, no result.');
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
Exit;
end;
arC := GetColors(arP);
ClearSameIntegers(arC);
arL := High(arC);
for i := 0 to arL do
begin
ColorToXYZ(arC[i], X, Y, Z);
if (X >= 2.76) and (X <= 36.79) and (Y >= 2.82) and (Y <= 37.91) and (Z >= 2.39) and (Z <= 40.51) then
begin
Result := arC[i];
Writeln('AutoColor = ' + IntToStr(arC[i]));
Break;
end;
end;
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
if (i = arL + 1) then
Writeln('AutoColor failed in finding the color.');
end;
ACA function for finding the door colors but I couldn't seen to find anywhere how to add in to climb down it, anyone free to help would be greatly appreciated.
Tutorials: Creating Custom SPS Minimap Maps + How to Use SPS | Bitmap Tutorial (For Finding Items In Inventory + Bank) + Implementing Into A Script
Private: RS3 AstralRcRunner
Currently: Looking for a script request
There is a functionSimba Code:FindSymbol(var rx, ry: Integer; Name: string) : Boolean;
you could do something like
Simba Code:Procedure ClickFountain;
Var
x, y : integer
begin
if(FindSymbol(x, y, 'water source'))then
Mouse(x, y, 5, 5, mouse_Left);
end;
You need an "Until" at the end for your "Repeat" part:
Simba Code:Repeat
ItIsRaining;
Until(ItIsntRaining);
So yours would look like:
Simba Code:procedure Obstacle;
var
x, y: integer;
begin
repeat
FindNormalRandoms;
WriteLn('Looking for obstacle net.');
if FindObj(x, y, 'bstacle net', 4084847, 10) then
begin
WriteLn('Climbing Obstacle.');
Mouse(x, y, 0, 0, true);
If isUpText('limb-over') then
begin
ChooseOption('limb-over');
exit;
end;
Until(false);
end;
I think you have used the wrong thing in ACA, use ACA again but us the FindObject, post what you get and I will help you turn that into a function for going down the trap door..
Last edited by putonajonny; 04-06-2012 at 02:46 PM.
i have two questions
1. how do i use the MouseBox function(how do I find the coordinates of the box I want to make and how to do i make the box)
2. not sure how to ask this so ill post some code from yojo's script, basically how do i use a function like this to accurately pick colors in my script.... I tried using object tpa's and it fails.... when i try to find colors in the mining guild it keeps finding the black outline of the map(color 0) even when its not highlighted in ACA. even when I adjust the color tolerence to 0 it still finds the outside of the map >.>
Function MineRock(WutRock:Integer):Boolean;
var I,PlusOne,tMine,J, L:Integer;
RockInFoI: TIntegerArray;
RockInFoE: TExtendedArray;
RockPts:TPointArray;
RockPtsBox: T2DPointArray;
BingoPt: TPoint;
Begin
If Not(LoggedIn) Then Exit;
J:=0;
//StatsGuise('Searching For Rock: '+ IntToStr(InvCount));
If InvFull Then Exit;
Case WutRock of
1: Begin RockInFoE:=[0.02 , 3.07]; RockInFoI:=[4622062, 5]; End; //BCop
2: Begin RockInFoE:=[0.03 , 0.09]; RockInFoI:=[4088717, 9]; End; //DCop
3: Begin RockInFoE:=[0.13 , 0.33]; RockInFoI:=[11382456, 12]; End; //Tin
4: Begin RockInFoE:=[0.06 , 0.87]; RockInFoI:=[3293285, 7]; End; //Iron
5: Begin RockInFoE:=[0.00 , 0.53]; RockInFoI:=[1579546, 5]; End; //Iron
End;
{Get Rock Points Only}
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(RockInFoE[0],RockInFoE[1]);
FindColorsSpiralTolerance(MSCX, MSCY, RockPts, RockInFoI[0], MSX1, MSY1, 507, 270, RockInFoI[1]);
SetColorSpeed2Modifiers(0.2,0.2);
ColorToleranceSpeed(1);
RockPtsBox:=TPAtoATPAEx(RockPts,35,35);
//DebugATPA(RockPtsBox, '');
{/Get Rock Points Only}
L:= High(RockPtsBox)
For I:=0 To L Do
Begin
PaintReport;
If GetArrayLength(RockPtsBox[I])>7 Then
Begin
BingoPt:= MiddleTPA(RockPtsBox[I]);
If CheckAndClick('ine', BingoPt.x,BingoPt.y, 'L') Then
Begin
PlusOne:=InvCount+1;
Result:=True;
MarkTime(tMine);
StatsGuise('Mining Rock: '+ IntToStr(InvCount+1));
Players[CurrentPlayer].Loc:='Mining';
wait(500 + Random(1000));
MMouse(582, 228, 7, 7);
Repeat
PaintReport;
Antiban;
RT:=GetSystemTime;
If FindNormalRandoms Then
IncEx(WeMined,GetSystemTime - RT);
// If Random(2500)=1 Then SleepAndMoveMouse(3500+Random(500));
Until (InvCount = PlusOne) Or (TimeFromMark(tMine) > ((Players[CurrentPlayer].Integers[2]*1000) + Random(500)));
If InvCount=PlusOne Then
Begin
DebugXP;
Inc(J);
Inc(TOres);
Inc(Players[CurrentPlayer].Integers[80]); //Ores
Case Players[CurrentPlayer].Integers[1] Of
1,2: Stats_IncVariable('Copper Ore (Mined)', J);
3: Stats_IncVariable('Tin Ore (Mined)', J);
4: Stats_IncVariable('Iron Ore (Mined)', J);
5: Stats_IncVariable('Coal Ore (Mined)', J);
End;
Stats_IncVariable('Total EXP Gained', Round(J*(Players[CurrentPlayer].Extendeds[1])));
IncEx(TExperiance, Round(J*(Players[CurrentPlayer].Extendeds[1])) );
J:= 0;
If ( (TOres Mod 28) = 0 ) Then
Begin
If TOres=0 Then Exit;
Inc(TLoads);
stats_IncVariable('Loads Done', 1);
Inc(Players[CurrentPlayer].Integers[81]); //Total Loads
Inc(Players[CurrentPlayer].Integers[82]); //Temp Loads
ProgressReport;
End;
PaintReport;
Break;
End;
Exit;
End Else Continue;
End Else Continue;
End;
End;
For your first problem:
Imagine the box you want to search in.
Now get the color picker tool and click the top left hand corner of the box.
Now click the bottom right hand corner of the box.
Now get those 4 numbers(2 coordinates) and replace them with xs, ys, xe and ye within the MouseBox function. It will now click within the box you want it to.
For your second problem:
Make sure you search within the mainscreen. to do this replace xs, ys, xe and ye in your color finding function with MSX1, MSY1, MSX2, MSY2
Simply a GOD beast...
My Tutorials
Is there a code to restart the script after a certain amount of time? Like a sleep function? If something goes wrong, I want my script to stop and restart from the top after 30 minutes.
Is there a function to do this or another way?
I think I have just figured it out.
Simba Code:program stopifyouwantabreak;
function mainloop: boolean;
vars
stoptime : integer;
begin
//the purpose of the function.......here
if(something = wrong) then
begin
//you want it to stop,
stoptime = 3600;//in seconds
result:= false;
exit;
end;
//the rest of your mainloop function.... but whenever you want to stop, you just fill in stoptime, result false and exit;
end;
begin
repeat
repeat
mainloop;
logout;
wait(stoptime*1000);
until stop=true;
until false;
end.
Will this work? Or is the variable stoptime I make in the function mainloop only functional in the function? I don't know if that's true in pascal, but in PHP this wouldn't work....
and this way is maybe a little too hard, because if i also want to let it happen in other functions, (for example I use a function for checking a random, I want to logout and retry after 30 minutes if it fails) if this happens and it isnt in the main function, exit doesnt work because then it will only go back to the mainloop function.... is there a piece of code that will exit all your functions? LikeSimba Code:exit(ALL);
Thanks for your help, and if this isnt' the best way, please give me a little example for a better way.![]()
What you're looking to do could be as simple as:
Simba Code:var
BreakTime, t: Integer;
begin
BreakTime := (30 * 1000);
repeat
SetupScript;
// ...
MarkTime(t);
repeat
MainLoop;
// ...
if BreakEarly then // Nifty feature #1
Break;
if NoBreak then // Nifty feature #2
MarkTime(t);
until (TimeFromMark(t) >= BreakTime)
until (Whatever)
end.
Last edited by Runaway; 06-15-2012 at 04:38 PM.
There are currently 1 users browsing this thread. (0 members and 1 guests)