Results 1 to 8 of 8

Thread: Need help Fixing Dumb Boolean Problem

  1. #1
    Join Date
    Jul 2008
    Location
    US
    Posts
    104
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Need help Fixing Dumb Boolean Problem

    Heres my Procedure. O and the (E) is where the error is...

    SCAR Code:
    Procedure WalkToFurnace;
    var x,y,XPush, YPush,WalkMethod:integer;
    Begin
      if Bankscreen then
      Begin
        Closebank;
      end;
      MakeCompass('n');
      Wait(500+Random(500));
      SetAngle(true);
      Wait(2000+Random(500));
      SW1Work := DTMRotated(ShopWalk1,x,y, MMX1, MMY1, MMX2, MMY2); //Makes Sure that DTM Works
      SW2Work := DTMRotated(ShopWalk2,x,y, MMX1, MMY1, MMX2, MMY2); //Makes Sure that DTM Works
    //Ends Script If none of The DTM's Work, it Terminates the Script
      IF SW1Work(ERROR) nor SW2Work then  //WHERE ERROR IS! AFTER SW1Work
        Begin
        Writeln('NO Shop DTMS Are Working');
        LogOut;
        //Report;
        TerminateScript;
        End;
    //If Both DTMS Work, Sets them up, with some ANTIBAN involved
      IF SW2Work and SW1Work then
      begin
       Case Random(1) of
        0: WalkMethod :=ShopWalk1;
           XPush :=5;
           YPush :=5;

        1: WAlkMethod :=ShopWalk2;
           XPush :=5;
           YPush :=5;
        End;
      end;

      IF (DTMRotated(WalkMethod,x,y, MMX1, MMY1, MMX2, MMY2)) then
      Begin
      WriteLn('Walking Toward Furnace Half Way Done!!')
      Mouse((X+XPush), (Y+YPush), 3,3, True);
      FFlag(8);
      SymbolAccuracy: 5;
      FindSymbol(rx, ry, 'furnace');
      Mouse(rx, ry+8, 3, 4, true);
      Flag;
      AntiBan;
    //Probally Needs Another Failsafe for after the symbol finding. just incase
    End;

    error:
    Code:
    Line 276: [Error] (21401:12): 'THEN' expected in script
    What is causing this? Am I using 'Nor' wrong?

    I haven't finished Report yet. thats why theres //'s. And I'm sure my standards aren't the greatest. I was hoping some one could maybe Give me an idea, about how to make the whole, SW1Work and SW2Work finding faster.

    And if Somebody Could lighten up my Standards, it'd be nice. Standards are still a little distant for me.

    I know its gonna slow it down a bunch, having to try to find them everytime!
    None of the Integers are right. I just made a layout for myself.

  2. #2
    Join Date
    Feb 2006
    Location
    Tracy/Davis, California
    Posts
    12,631
    Mentioned
    135 Post(s)
    Quoted
    418 Post(s)

    Default

    SCAR Code:
    IF (Not(SW1Work)) and  (Not(SW2Work)) then
    Is that what your trying to do?
    I personally have never seen nor.

    Also,
    Change
    DTMRotated to FindDTMRotated

    Standardized/Fixed up small stuff:
    SCAR Code:
    Procedure WalkToFurnace;
    var x,y,XPush, YPush,WalkMethod:integer;
    Begin
      if Bankscreen then
      Closebank;
      MakeCompass('n');
      Wait(500+Random(500));
      SetAngle(true);
      Wait(2000+Random(500));
      SW1Work := FindDTMRotated(ShopWalk1,x,y, MMX1, MMY1, MMX2, MMY2); //Makes Sure that DTM Works
      SW2Work := FindDTMRotated(ShopWalk2,x,y, MMX1, MMY1, MMX2, MMY2); //Makes Sure that DTM Works
    //Ends Script If none of The DTM's Work, it Terminates the Script
      If (Not(SW1Work)) and (Not(SW2Work)) then  //WHERE ERROR IS! AFTER SW1Work
      Begin
        Writeln('NO Shop DTMS Are Working');
        LogOut;
        //Report;
        TerminateScript;
      end else
      begin
       Case Random(1) of
        0: WalkMethod :=ShopWalk1;
           XPush :=5;
           YPush :=5;

        1: WAlkMethod :=ShopWalk2;
           XPush :=5;
           YPush :=5;
        End;
      end;
      If (FindDTMRotated(WalkMethod,x,y, MMX1, MMY1, MMX2, MMY2)) then
      Begin
        WriteLn('Walking Toward Furnace Half Way Done!!')
        Mouse((X+XPush), (Y+YPush), 3,3, True);
        FFlag(8);
        SymbolAccuracy: 5;
        FindSymbol(rx, ry, 'furnace');
        Mouse(rx, ry+8, 3, 4, true);
        Flag;
        AntiBan;
    //Probally Needs Another Failsafe for after the symbol finding. just incase
    End;

    You should get rid of the "TerminateScript" , since (if your planning to make it multilayer) you just just logout and do NextPlayer(false) instead. Also, no need to have two different shop DTMs for "randomness" (like when you use a case to use one or another DTM). Clicking on the minimap is never the same or anything, instead you should use both as a doublechecklike:
    SCAR Code:
    If FindDTMRotated(ShopWalk1,x,y, MMX1, MMY1, MMX2, MMY2) or
      If FindDTMRotated(ShopWalk2,x,y, MMX1, MMY1, MMX2, MMY2) Then
    Last edited by YoHoJo; 10-09-2009 at 08:57 PM.

  3. #3
    Join Date
    Jul 2008
    Location
    US
    Posts
    104
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by YoHoJo View Post
    SCAR Code:
    IF (Not(SW1Work)) and  (Not(SW2Work)) then
    Is that what your trying to do?
    I personally have never seen nor.
    YoHoJo, how come every time i need help, you're always handy? lol

    Well theres a tut some where, i think its called 'Fun With Booleans' and it explained alot of weird boolean comands such as... nand, nor, xnor, and i cant remember the other weird one.

    anyways, i thought I'd just use nor so people would be like, "Wow, I actually learned something from this Noob's script!" lol...

  4. #4
    Join Date
    Jul 2008
    Location
    US
    Posts
    104
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by YoHoJo;
    [SCAR
    If FindDTMRotated(ShopWalk1,x,y, MMX1, MMY1, MMX2, MMY2) or
    If FindDTMRotated(ShopWalk2,x,y, MMX1, MMY1, MMX2, MMY2) Then[/SCAR]
    If I did that, how would i use my XPush and YPush?

    They're different for each DTM.

    And the Reason i used

    SCAR Code:
    Case Random(1) of
        0: WalkMethod :=ShopWalk1;
           XPush :=5;
           YPush :=5;

        1: WAlkMethod :=ShopWalk2;
           XPush :=5;
           YPush :=5;
        End;

    is to, if both DTM's work, Randomly pick one to use. they both lead to a distance close enough to find the symbol
    Last edited by reddevil12312; 10-09-2009 at 09:04 PM.

  5. #5
    Join Date
    Feb 2006
    Location
    Tracy/Davis, California
    Posts
    12,631
    Mentioned
    135 Post(s)
    Quoted
    418 Post(s)

    Default

    SCAR Code:
    Case Random(1) of
        0: WalkMethod :=ShopWalk1;
           XPush :=5;
           YPush :=5;

        1: WAlkMethod :=ShopWalk2;
           XPush :=5;
           YPush :=5;
    Pushes are x=5 y=5 for both?

    Anyways:

    SCAR Code:
    If FindDTMRotated(ShopWalk1,x,y, MMX1, MMY1, MMX2, MMY2) Then
      Begin
          Mouse((X+XPush), (Y+YPush), 3,3, True);
          bla bla
          Walking
      end else
      If FindDTMRotated(ShopWalk2,x,y, MMX1, MMY1, MMX2, MMY2) Then
      Begin
          Mouse((X+XPush), (Y+YPush), 3,3, True);
          bla bla
          Walking
      end else
      Begin
        Writeln('i pahil at scptz');

  6. #6
    Join Date
    Jul 2008
    Location
    US
    Posts
    104
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by YoHoJo View Post
    SCAR Code:
    Case Random(1) of
        0: WalkMethod :=ShopWalk1;
           XPush :=5;
           YPush :=5;

        1: WAlkMethod :=ShopWalk2;
           XPush :=5;
           YPush :=5;
    Pushes are x=5 y=5 for both?

    Anyways:
    That's my bad lol. I didn't make that very clear. For the (X,Y)Pushes... i just set them to 5 because i hadn't actually figured out how much they should be. they'll all most likely be a lot different.

    But it wont be that hard, plugging in those const's while still using your version. thanks. Ending Note: The reason i used cases, just thought it look better lol..

  7. #7
    Join Date
    Feb 2006
    Location
    Tracy/Davis, California
    Posts
    12,631
    Mentioned
    135 Post(s)
    Quoted
    418 Post(s)

    Default

    Well, the case only uses 1 of the DTMs, whilst the other way uses both=greater chance of it working.

  8. #8
    Join Date
    Jul 2008
    Location
    US
    Posts
    104
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Okay I've sort of redid the whole procedure. One is better for antiban, and the other is better for just getting the job done. Which one Would you think would be better for the script overall.

    Here's the first version. It looks kinda funky, but its just to see if the dtm's work, and if both do, randomly pick one. I really just sort of threw it together... but oh well...

    SCAR Code:
    Procedure WalkToFurnace;
    var x,y,XPush, YPush,WalkMethod,RX,RY:integer;
    Begin
      if Bankscreen then
      Begin
        Closebank;
      end;
      MakeCompass('n');
      Wait(500+Random(500));
      SetAngle(true);
      Wait(2000+Random(500));
      IF Not DTMCheck then
      Begin
    //Only happens once. To Save time
        SW1Work := DTMRotated(ShopWalk1,x,y, MMX1, MMY1, MMX2, MMY2); //Makes Sure that DTM Works
        SW2Work := DTMRotated(ShopWalk2,x,y, MMX1, MMY1, MMX2, MMY2); //Makes Sure that DTM Works
        DTMCheck :=True;
      End;
    //Ends Script If none of The DTM's Work, it Terminates the Script
      IF (Not(SW1Work)) And (Not(SW2Work)) then
        Begin
        Writeln('NO Shop DTMS Are Working');
        LogOut;
        //Report;
        TerminateScript;
        End;
    //If Both DTMS Work, Sets them up, with some ANTIBAN involved
      IF SW2Work and SW1Work then
      begin
       WriteLn('Using Random ShopDTM Finding');
       Case Random(1) of
        0:Begin
            WalkMethod :=ShopWalk1;
            XPush :=3;
            YPush :=6;
          End;
        1:Begin
            WAlkMethod :=ShopWalk2;
            XPush :=4;
            YPush :=7;
          End;
        End;
      end;
    //If only one DTM Works, Uses Workable one
      IF SW1Works xor SW2Works then
      Begin
        IF SW1Works then
          Begin
            WalkMethod := ShopWalk1;
          End Else
            WalkMethod := ShopWalk2;
          End;
      End;

      IF (DTMRotated(WalkMethod,x,y, MMX1, MMY1, MMX2, MMY2)) then
      Begin
      WriteLn('Walking Toward Furnace Half Way Done!!')
      Mouse((X+XPush), (Y+YPush), 3,3, True);
      FFlag(8);
      SymbolAccuracy: 5;
      FindSymbol(rx, ry, 'furnace');
      Mouse(rx, ry+8, 3, 4, true);
      Flag;
      AntiBan;
    //Probally Needs Another Failsafe for after the symbol finding. just incase
    End;

    Here's the second version. I got pretty much the whole idea of it from YoHoJo (just for credit i guess). This doesn't have a whole lot of randomness, and some of the (X,Y) locations haven't been completely adjusted (notice the ?'s), so ignore that part.

    SCAR Code:
    Function WAlktoFurnace: Boolean;
    var x,y,x2,y2,FurX,FurY,YVal:Integer;
    Begin
      If DTMRotated(ShopWalk1,x,y,MMX1,MMY1,MMX2,MMY2) Then
      Begin
        Mouse((x-?),(y+?),4,5, true);
        FFlag(8);
      End Else
      Begin
        If DTMRotated(ShopWalk2,X,Y, MMX1,MMY1,MMX2,MMY2) Then
        Begin
          Mouse((x-?),(y-?),3,4,True);
          FFlag(5);
        End Else
        Begin
          WriteLn('Shop DTMs dont Work!');
          LogOut;
          Report;
          TerminateScript;
        End;
      End;
    //End of First Step of the Walking
      If FindSymbol('furnace',X2,Y2 Then
      Begin
        Result := True;
        Mouse(X2,(Y2-?),3,3,True);
        If FlagPresent Then
        Begin
          Flag(0);
          WriteLn('Succesfully Made Trip to Furnace');
          Wait(0+random(2000);
          Exit;
         End Else
         Begin
           MouseFlagEx(X2, Y2, 3 , 3, 1, 1, 0);
           WriteLn('Finally Found Symbol');
         End;
       End Else
       Begin
         WriteLn('Could Not Find Furnace Symbol');
         LogOut;
         Report;
         TerminateScript;
       End;
    End;

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •