I am having trouble making a variable = 0 only at the start of the script. can someone please tell me where i can declare it to do this?
I am having trouble making a variable = 0 only at the start of the script. can someone please tell me where i can declare it to do this?
Like this?
Simba Code:program Test;
Var
Number:Integer;
procedure DoStuff;
begin
Writeln('stuff')
end;
begin
Number := 0
repeat
DoStuff;
Until False;
end.
thats exactly where i put it and if all of my other coding was correct then it was declaring it as 0 randomly throughout the script
i'm pretty sure its not my code, i'm still having the problem, it doesn't declare it as 0 randomly, everytime the script restarts and goes through the main process it happens.
Last edited by blockay; 02-27-2013 at 02:31 AM.
It's 0 by default, and everytime it gets called again. It turns to 0 again.
Creds to DannyRS for this wonderful sig!
this is what i have, it doesn't work properlybegin
run := 0;
if (run = 0) then
begin
MarkTime(i)
turnRunOn;
z := 1;
end;
end;
Try putting it in SIMBA tags instead of QUOTE tags. But anyway, I believe your issue is because (although I can't see all your code) that you're looping through that situation, re-initializing run to 0. If you only want it to equal 0 for the first run, never set it at all, just delete that line.
My Outdated ScriptsEdgeville Log Cutter | Edgeville AIO Jewelry | AIO Pickpocketer | Urn Activator | Slayer Tower | Slaying KuradalMy Working Scripts: Tutorials:Function Pointers and Why You Should Care! | Forms and Saving Settings | The Magic Behind Programming Tutorial | Recursive Recursion![]()
i have it like this, i don't believe that run := 0; is in the loop this way. but i will try to not declare := 0; and report back if it works or notSimba Code:begin
run := 0;
repeat
if (run = 0) then
begin
MarkTime(i)
turnRunOn;
z := 1;
end;
until (false)
end;
edit: i tried it without having run:= 0; didn't work.
Last edited by blockay; 02-27-2013 at 06:31 PM.
Try showing us your entire script so we can see if the issue lies elsewhere as well?
My Outdated ScriptsEdgeville Log Cutter | Edgeville AIO Jewelry | AIO Pickpocketer | Urn Activator | Slayer Tower | Slaying KuradalMy Working Scripts: Tutorials:Function Pointers and Why You Should Care! | Forms and Saving Settings | The Magic Behind Programming Tutorial | Recursive Recursion![]()
Simba Code:program CutterShafter;
{$I SRL/SRL.Simba}
{$I P07Include.Simba}
var
x, aInteger, inventory, math, TreeColor3, k, y, i, z, run, logs, knife, TreeColor, TreeColors: integer;
procedure DTM;
begin
TreeColor := 4162679;
TreeColors := 2574918;
TreeColor3 := 2902849;
runIsOn := 1777019;
end;
Procedure P07_DeclarePlayer;
Begin
P07_PlayerName:='';
P07_PlayerPass:='';
end;
Procedure CallThings;
Begin
{Going to Name the Bitmap string " Ring ", and declare the variable under Var}
knife:= BitmapFromString(10, 10, 'meJwztnE1tfMwBpIOnowMDCUlNY' +
'WFVVlZRX39M4FcoDgEAdllZXVA2dy88rS03HnzVkFkgbpMHdwgsvk' +
'FlRkZ+ZMmzQVyFRQMrJy8IWZWVDQAzczOKU1JyV68eD1EFq4RYiZQ' +
'47TpiyBSEFkgm9MqFIhmzlrW2TVl2fJNEFmIYyBScAVYNUIQr0cO3' +
'D1AhFUKUxZZCuxUEAIANwhKdQ==');
logs := BitmapFromString(7, 13, 'meJwL6F8f0L9eNqTcNq3VOqUJggL' +
'AgnBxiBRcBKLGKrEeiGTDq0AooAjCBSIttyizqDKgiEV8jZ5fGhwB' +
'BaW8s6U8MkwjiiDIODQfpBKsXcovH6gegoDKkB0AsQuoDFMQUyUQi' +
'TvHYwoyMjDABYEILgg3FqgSohgA9ylm1w==');
End;
Procedure FreeThings;
Begin
FreeBitMap(logs);
FreeBitMap(knife);
End;
procedure findTree;
Begin
if not (P07_FindObjCustom(x, y, [ree, tre], [TreeColor, TreeColor3, TreeColors], 1)) Then
case RandomRange(1,1000) of
1..250: P07_MakeCompassNorth;
251..500: P07_MakeCompassEast;
501..750: P07_MakeCompassSouth;
751..1000: P07_MakeCompassWest;
end;
End;
Function IsCutting: Boolean;
var
PBox: TBox;
Begin
PBox := IntToBox(238, 149, 286, 186);
Result := (AveragePixelShift(PBox, 250, 350) > 350);
Writeln(IntToStr(AveragePixelShift(PBox, 500, 650)));
End;
Function IsWcing: Boolean;
var
PBox: TBox;
Begin
PBox := IntToBox(238, 149, 286, 186);
Result := (AveragePixelShift(PBox, 250, 350) > 150);
Writeln(IntToStr(AveragePixelShift(PBox, 500, 650)));
End;
Function IsFletching: Boolean;
var
PBox: TBox;
Begin
PBox := IntToBox(250, 145, 273, 175);
Result := (AveragePixelShift(PBox, 250, 350) > 75);
Writeln(IntToStr(AveragePixelShift(PBox, 500, 650)));
End;
procedure makeShafts;
Begin
MarkTime(thaTime);
If FindBitMapToleranceIn(logs, x, y, MIX1, MIY1, MIX2, MIY2, 50) Then
Mouse(x, y, Random(3), Random(3), true);
P07_ChooseOptionMulti(['weiner']);
P07_MakeCompassNorth;
If FindBitMapToleranceIn(knife, x, y, MIX1, MIY1, MIX2, MIY2, 50) Then
Mouse(x, y, Random(3), Random(3), true);
P07_ChooseOptionMulti(['use']);
P07_MouseBox(24, 435, 130, 452, 3);
Wait(RandomRange(400,500));
ClickMouse2(Mouse_Right);
Wait(RandomRange(300,400));
P07_ChooseOptionMulti(['ake X', 'X']);
Wait(RandomRange(750,900));
SendKeys('88', 95, 35);
Wait(RandomRange(300, 400));
P07_UseKey(13);
Wait(RandomRange(3000, 5000));
If IsFletching then
begin
inventory := P07_InvCount;
repeat
repeat
if TimeFromMark(thaTime) > 50000 then Break;
Wait(500);
until (inventory < P07_InvCount);
until (P07_InvCount < 4);
end
else
if (P07_InvCount > 4) then
begin
inventory := P07_InvCount;
repeat
repeat
if TimeFromMark(thaTime) > 50000 then Break;
Wait(500);
until (inventory < P07_InvCount);
until (P07_InvCount < 4);
end;
end;
Procedure turnRunOn;
begin
if i > (math) then
begin
P07_MouseBox(665, 470, 686, 493, 3);
Wait(RandomRange(400,500));
ClickMouse2(Mouse_Left);
If (Not FindColorTolerance(x,y,runIsOn,625,413,658,447, 4)) Then
begin
P07_Mousebox(625, 413, 658, 447, 3);
Wait(RandomRange(200, 350));
ClickMouse2(Mouse_Left);
Wait(RandomRange(200, 350));
P07_TabInventoryTab(4);
z := (z + 1);
end
else
If FindColorTolerance(x,y,runIsOn,625,413,658,447, 4) Then
begin
P07_TabInventoryTab(4);
z := (z + 1);
end;
end;
end;
procedure ChopTree;
begin
If not IsWcing then
If P07_FindObjCustom(x, y, ['Tree', 'own Tr'], [TreeColor, TreeColor3, TreeColors], 1) Then
if Random(28) = 1 then
begin
ClickMouse2(mouse_right);
P07_ChooseOptionMulti(['Chop']);
Wait(RandomRange(500, 1000));
end
else
begin
ClickMouse2(mouse_left);
P07_ChooseOptionMulti(['Chop']);
Wait(RandomRange(550, 1000));
end
else
If not (P07_FindObjCustom(x, y, ['ree', 'tre'], [TreeColor, TreeColor3, TreeColors], 1)) Then
case random(1000) of
1..250: P07_MakeCompassNorth;
251..500: P07_MakeCompassEast;
501..750: P07_MakeCompassSouth;
751..1000: P07_MakeCompassWest;
end;
end;
procedure waiting;
begin
MarkTime(thaTime);
aInteger := P07_InvCount
if IsCutting then
repeat
if TimeFromMark(thaTime) > 12000 then Break;
Wait(500);
Until (P07_InvCount > aInteger)
end;
begin
run := 0;
DTM;
CallThings;
P07_DeclarePlayer;
SetupP07Include;
ActivateClient;
P07_MakeCompassNorth;
Addonterminate('FreeThings')
Wait(1000);
repeat
math := (100000 * z);
If (Not P07_LoggedIn) Then
begin
P07_LogInPlayer;
P07_MakeCameraAngleHigh;
end;
if (run = 0) then
begin
MarkTime(i)
turnRunOn;
z := 1;
end;
if(P07_InvFull) then
repeat
k := 1;
IsFletching;
makeShafts;
until (P07_InvCount < 4)
else
if not (P07_InvFull) then
begin
repeat
findTree;
ChopTree;
waiting;
until (P07_InvFull)
end;
Until (false)
FreeThings;
End;
(responding publicly after a pm of his script)
You never set the variable to 1. You will need to setinside either your "turnRunOn" procedure or inside:Simba Code:run:=1;Simba Code:if (run = 0) then
begin
MarkTime(i)
turnRunOn;
z := 1;
end;
My Outdated ScriptsEdgeville Log Cutter | Edgeville AIO Jewelry | AIO Pickpocketer | Urn Activator | Slayer Tower | Slaying KuradalMy Working Scripts: Tutorials:Function Pointers and Why You Should Care! | Forms and Saving Settings | The Magic Behind Programming Tutorial | Recursive Recursion![]()
Last edited by blockay; 02-27-2013 at 07:08 PM.
My Outdated ScriptsEdgeville Log Cutter | Edgeville AIO Jewelry | AIO Pickpocketer | Urn Activator | Slayer Tower | Slaying KuradalMy Working Scripts: Tutorials:Function Pointers and Why You Should Care! | Forms and Saving Settings | The Magic Behind Programming Tutorial | Recursive Recursion![]()
A boolean is just a variable that is only ever "True" or "False". All if statements are actually boolean checks. For example: your "if(run=0)" is evaluating whether or not "run" is set to 0 and creating a temporary boolean (that is evaluated to be true first run, false every other run) that determines whether or not it goes into the if.
FindObj() returns a boolean telling you whether or not it found the object. The values in the parenthesis are values you pass to the procedure so it knows what it's looking for.
My Outdated ScriptsEdgeville Log Cutter | Edgeville AIO Jewelry | AIO Pickpocketer | Urn Activator | Slayer Tower | Slaying KuradalMy Working Scripts: Tutorials:Function Pointers and Why You Should Care! | Forms and Saving Settings | The Magic Behind Programming Tutorial | Recursive Recursion![]()
awesome. i'll definitely start using them
thanks for all of your help i appreciate it
There are currently 1 users browsing this thread. (0 members and 1 guests)