Need help with script

Discussion in 'Scar/Simba Help' started by Psyko, Jan 4, 2009.

Need help with script
  1. Unread #1 - Jan 4, 2009 at 9:49 PM
  2. Psyko
    Joined:
    Jan 4, 2009
    Posts:
    2
    Referrals:
    0
    Sythe Gold:
    0

    Psyko Newcomer

    Need help with script

    I'm new to scar scripting and tried to make something to auto smelt stuff, but when i run it, it clicks stuff around and doesnt seem to follow my coords also skip the "wait();" lines apparently.

    This should work as this : Start with 9 steel bars in backpack standing next to the falador furnace, it should then walk to the bar and then to the bank, deposit the bars and grab ores, smelt 9 bars and loop 100 times.

    I play on a 18" monitor 1280x1024 with the windows client if anyone wanna test with the same coords.

    Code:
    program SmeltSteel;
    
    Var
    i,x,y: integer;
    Const
    FloorColor = 8100517;
    BootColor = 3758451;
    FurnaceColor = 2698289;
    
    //Furnace --> Bar
    Procedure FurnaceToBar;
      begin
        if(FindColor(x,y,FloorColor,1104,43,1124,93)) then
        begin
          MoveMouseSmoothEx(x,y +random(0),20,40,45,25,20);
          Wait(100+random(10));
          ClickMouse(x,y,true);
          Wait(12000);
        end;
      end;
      
    //Bar --> Bank
    Procedure BarToBank;
      begin
        if(FindColor(x,y,FloorColor,1105,64,1145,106)) then
        begin
          MoveMouseSmoothEx(x,y +random(0),20,40,45,25,20);
          Wait(100+random(10));
          ClickMouse(x,y,true);
          Wait(12000);
        end;
      end;
      
    //Open bank
    Procedure OpenBank;
      begin
        if(FindColor(x,y,BootColor,561,403,1219,790)) then
          begin
              MoveMouseSmoothEx(x,y +random(0),20,40,45,25,20);
              Wait(100+random(10));
              ClickMouse(x,y,true);
              Wait(2000);
          end;
      end;
      
    //Bank Dialog
    Procedure BankDialog;
      begin
        MoveMouseSmoothEx(305,786 +random(0),20,40,45,25,20);
        Wait(100+random(10));
        ClickMouse(305,786,true);
        Wait(2000);
        MoveMouseSmoothEx(266,724 +random(0),20,40,45,25,20);
        Wait(100+random(10));
        ClickMouse(266,724,true);
        Wait(2000);
      end;
      
    //Deposit bars and grab ores
    Procedure Deposit;
      Begin
        //Deposit bars
        MoveMouseSmoothEx(1095,554 +random(0),20,40,45,25,20);
        Wait(100+random(10));
        ClickMouse(1095,554,false);
        Wait(100);
        MoveMouseSmoothEx(1095,610 +random(0),20,40,45,25,20);
        Wait(100+random(10));
        ClickMouse(1095,610,true);
        Wait(100);
        //take iron ores
        MoveMouseSmoothEx(554,396 +random(0),20,40,45,25,20);
        Wait(100+random(10));
        ClickMouse(554,396,false);
        Wait(100);
        MoveMouseSmoothEx(554,467 +random(0),20,40,45,25,20);
        Wait(100+random(10));
        ClickMouse(554,467,true);
        Wait(100);
        //take coal ores
        MoveMouseSmoothEx(600,395 +random(0),20,40,45,25,20);
        Wait(100+random(10));
        ClickMouse(600,395,false);
        Wait(100);
        MoveMouseSmoothEx(600,496 +random(0),20,40,45,25,20);
        Wait(100+random(10));
        ClickMouse(600,496,true);
        Wait(100);
      end;
      
    //Bank --> Bar
    Procedure BankToBar;
      Begin
        if(FindColor(x,y,FloorColor,1217,45,1244,98)) then
          begin
            MoveMouseSmoothEx(x,y +random(0),20,40,45,25,20);
            Wait(100+random(10));
            ClickMouse(x,y,true);
            Wait(12000);
          end;
      end;
      
    //Bar --> Furnace
    Procedure BarToFurnace;
      Begin
        if(FindColor(x,y,FloorColor,1231,92,1242,115)) then
          begin
            MoveMouseSmoothEx(x,y +random(0),20,40,45,25,20);
            Wait(100+random(10));
            ClickMouse(x,y,true);
            Wait(12000);
          end;
      end;
      
    //Click Furnace
    Procedure Furnace;
      begin
        if(FindColor(x,y,FurnaceColor,700,541,1249,794)) then
          begin
            MoveMouseSmoothEx(x,y +random(0),20,40,45,25,20);
            Wait(100+random(10));
            ClickMouse(x,y,true);
            Wait(100);
          end;
      end;
      
    //Smelt ores
    Procedure SmeltOres;
      Begin
      //Smelt steel
        MoveMouseSmoothEx(261,733 +random(0),20,40,45,25,20);
        Wait(100+random(10));
        ClickMouse(261,733,false);
        Wait(100);
        MoveMouseSmoothEx(261,792 +random(0),20,40,45,25,20);
        Wait(100+random(10));
        ClickMouse(261,792,true);
        Wait(32000);
      end;
        
    
    begin
    i:=0;
    Repeat;
    FurnaceToBar;
    BarToBank;
    OpenBank;
    BankDialog;
    Deposit;
    BankToBar;
    BarToFurnace;
    Furnace;
    SmeltOres;
    i:=i+1
    Until (i >= 100);
    end.
    
     
  3. Unread #2 - Jan 4, 2009 at 9:57 PM
  4. Jethr0x
    Joined:
    Jan 24, 2007
    Posts:
    3,070
    Referrals:
    13
    Sythe Gold:
    0

    Jethr0x Grand Master
    Banned

    Need help with script

    asdjahsdk, use SRL, alot easier :S
     
< Compiling erros on SSI2.scar and Boxbreaker2.txt | Scar wont use mouse, no compile errors though. >

Users viewing this thread
1 guest


 
 
Adblock breaks this site