wyn10 Posted April 17, 2012 Share Posted April 17, 2012 (edited) Fixed. Edited April 17, 2012 by wyn10 Quote Link to comment Share on other sites More sharing options...
LordJashin Posted April 17, 2012 Share Posted April 17, 2012 (edited) Semi-colons? Your standards are lacking. Try using WriteLn's to debug, and using the Step Into/Over Scar buttons. [sCAR] program ScarStandards; var X, Y, W: Boolean; // Global variables procedure WriteIt(Text: String); var a: Integer; // Local variable begin a := RandomRange(0, 10000); WriteLn(IntToStr(a) + ': ' + Text); // Use camelcase IntToStr not inttostr end; begin if X then //Use TAB key or Ctrl+Shift+i to indent X := True // No semi-colon, if it is just one statement else // This means if X is not true then execute this X := False; // Also one statement make sure this has a semi-colon if Y then begin Y := True; Y := True; end else begin Y := False; Y := False; // Multiple statements Y := False; end; // Nested: Things get tricky here, I doubt you will ever need to do this // most of the time you will use begin end; because you need multiple statements // The rule is if using "if then" "else" without begin end no semi-colon until // the last one which in this case is: WriteLn('W, X and Y are not true'); if Y then if X then if W then WriteLn('All of these have to be true for this to be written') else WriteLn('W is not True') else WriteLn('W and X are not true') else WriteLn('W, X and Y are not true'); end.[/sCAR] [sCAR] procedure Bank; Var BankCheck, WithdrawCheck, WithdrawCheck1 : Integer; begin if not (Bank_Location = Loc_SWB) then OSIFindRandoms; if (Bank_Location = Loc_SWB) then begin if not MakeCompass(Dir_West) then MakeCompass(Dir_West); // One here end; OpenBankBooth_SW(Bank_Location); // One here if not BankScreen or PinScreen then begin repeat Inc(BankCheck); Wait(300 + Random(200)); Writeln('BankCheck # ' + inttostr(BankCheck)); until (BankCheck = 5) or BankScreen; if (BankCheck = 5) then begin Writeln('Lag/To Soon, Attemping bank again'); if not (Bank_Location = Loc_SWB) then OSIFindRandoms; OpenBankBooth_SW(Bank_Location); end; end; Done := InvCount_NoTabCheck - 1; // One here FixBank(True); DepositItemsEx([26, 27], True, False); Withdraw(13, GetBankSlotIndex(Row, Column), True); // One here ////Skips everything after this WaitRR(400, 600); if (InvCount_NoTabCheck < 2) then begin repeat Inc(WithdrawCheck); Wait(150 + Random(50)); until (WithdrawCheck = 30) or (InvCount_NoTabCheck = 14); if (WithdrawCheck = 30) then begin ClearDebug; CloseBank(True); ExitToLobby; ProgressReport; Writeln('Ran out of supplies, First Check.'); TerminateScript; end; Withdraw(13, GetBankSlotIndex(Row1, Column1), True); // One here if (InvCount_NoTabCheck < 15) then begin repeat Inc(WithdrawCheck1); Wait(150 + Random(50)); until (WithdrawCheck1 = 30) or (InvFull(False)); if (WithdrawCheck1 = 30) then begin ClearDebug; CloseBank(True); ExitToLobby; ProgressReport; Writeln('Ran out of supplies, Second Check.'); TerminateScript; end; end; MouseSpeed := RandomRange(MinMouse, MaxMouse); CloseBank(True); end; end; [/sCAR] Edited April 17, 2012 by LordJashin Quote Link to comment Share on other sites More sharing options...
Wanted Posted April 17, 2012 Share Posted April 17, 2012 It's certainly not SCAR skipping half your procedure, the problem obviously lies somewhere within your coding. I'll get back to you if I come across it Quote Link to comment Share on other sites More sharing options...
wyn10 Posted April 17, 2012 Author Share Posted April 17, 2012 (edited) Semi-colons? Your standards are lacking. Try using WriteLn's to debug, and using the Step Into/Over Scar buttons. [sCAR] program ScarStandards; var X, Y, W: Boolean; // Global variables procedure WriteIt(Text: String); var a: Integer; // Local variable begin a := RandomRange(0, 10000); WriteLn(IntToStr(a) + ': ' + Text); // Use camelcase IntToStr not inttostr end; begin if X then //Use TAB key or Ctrl+Shift+i to indent X := True // No semi-colon, if it is just one statement else // This means if X is not true then execute this X := False; // Also one statement make sure this has a semi-colon if Y then begin Y := True; Y := True; end else begin Y := False; Y := False; // Multiple statements Y := False; end; // Nested: Things get tricky here, I doubt you will ever need to do this // most of the time you will use begin end; because you need multiple statements // The rule is if using "if then" "else" without begin end no semi-colon until // the last one which in this case is: WriteLn('W, X and Y are not true'); if Y then if X then if W then WriteLn('All of these have to be true for this to be written') else WriteLn('W is not True') else WriteLn('W and X are not true') else WriteLn('W, X and Y are not true'); end.[/sCAR] [sCAR] procedure Bank; Var BankCheck, WithdrawCheck, WithdrawCheck1 : Integer; begin if not (Bank_Location = Loc_SWB) then OSIFindRandoms; if (Bank_Location = Loc_SWB) then begin if not MakeCompass(Dir_West) then MakeCompass(Dir_West); // One here end; OpenBankBooth_SW(Bank_Location); // One here if not BankScreen or PinScreen then begin repeat Inc(BankCheck); Wait(300 + Random(200)); Writeln('BankCheck # ' + inttostr(BankCheck)); until (BankCheck = 5) or BankScreen; if (BankCheck = 5) then begin Writeln('Lag/To Soon, Attemping bank again'); if not (Bank_Location = Loc_SWB) then OSIFindRandoms; OpenBankBooth_SW(Bank_Location); end; end; Done := InvCount_NoTabCheck - 1; // One here FixBank(True); DepositItemsEx([26, 27], True, False); Withdraw(13, GetBankSlotIndex(Row, Column), True); // One here ////Skips everything after this WaitRR(400, 600); if (InvCount_NoTabCheck < 2) then begin repeat Inc(WithdrawCheck); Wait(150 + Random(50)); until (WithdrawCheck = 30) or (InvCount_NoTabCheck = 14); if (WithdrawCheck = 30) then begin ClearDebug; CloseBank(True); ExitToLobby; ProgressReport; Writeln('Ran out of supplies, First Check.'); TerminateScript; end; Withdraw(13, GetBankSlotIndex(Row1, Column1), True); // One here if (InvCount_NoTabCheck < 15) then begin repeat Inc(WithdrawCheck1); Wait(150 + Random(50)); until (WithdrawCheck1 = 30) or (InvFull(False)); if (WithdrawCheck1 = 30) then begin ClearDebug; CloseBank(True); ExitToLobby; ProgressReport; Writeln('Ran out of supplies, Second Check.'); TerminateScript; end; end; MouseSpeed := RandomRange(MinMouse, MaxMouse); CloseBank(True); end; end; [/sCAR] Lol ya, I don't usually write scripts for myself very neat. I just converted my script from Simba and that was the only thing I was having problems with, I've been told Simba fucked me over lol. It's certainly not SCAR skipping half your procedure, the problem obviously lies somewhere within your coding. I'll get back to you if I come across it Ok, hope you can tell me. Edited April 17, 2012 by wyn10 Quote Link to comment Share on other sites More sharing options...
Bixby Sayz Posted April 17, 2012 Share Posted April 17, 2012 (edited) Holy crap that is hard to read. You are using a number of row, col variables to get the bankslotindex but they are never given a value ahead of time; setup elsewhere I hope? This could be rewritten to be a lot more efficient. Not entirely sure what the "one here" comments represent. Seriously, rework this and your problems will likely go away. Edited April 17, 2012 by Bixby Sayz Quote Link to comment Share on other sites More sharing options...
wyn10 Posted April 17, 2012 Author Share Posted April 17, 2012 I have fixed this. Holy crap that is hard to read. You are using a number of row, col variables to get the bankslotindex but they are never given a value ahead of time; setup elsewhere I hope? This could be rewritten to be a lot more efficient. Not entirely sure what the "one here" comments represent. Seriously, rework this and your problems will likely go away. It's private for now, so I'm not worried about messiness at the moment. Quote Link to comment Share on other sites More sharing options...