[SRL] Magic Johnson's Rock Smasher [SRL]

Discussion in 'Outdated RS Scripts' started by Magic Johnson, Mar 6, 2007.

[SRL] Magic Johnson's Rock Smasher [SRL]
  1. Unread #1 - Mar 6, 2007 at 7:01 PM
  2. Magic Johnson
    Joined:
    Mar 6, 2007
    Posts:
    504
    Referrals:
    2
    Sythe Gold:
    0

    Magic Johnson Forum Addict
    Banned

    [SRL] Magic Johnson's Rock Smasher [SRL]

    I have been working on this power miner for a while now. It has very few bugs. First release, let me know what you think.

    {.Script Info:
    # ScriptName = Magic Johnson's Rock Smasher
    # Author = Magic Johnson
    # Description = An awesome powerminer
    # Version = 0.01
    /Script Info}

    program RockSmasher;
    {.include srl/srl.scar}
    {.include srl/srl/skill/mining.scar}
    {.include SRL\SRL\Misc\Trade.scar}

    {Setup lines 16 - 28 and Players Array is lines 163 - 165}

    const
    HMD = 10000; // How many loads to mine then drop
    mins = 15; // Log out every how many mins?
    forxmins = 3; // Stay logged out for how many mins?
    ranmins = 10; // Random mins to be added to mins
    ranlmins = 3; // Random mins to be added to forxmins
    RunDirection = 'N'; // Run away direction
    Rockname = 'Copper'; // The name of the rock you are mining
    UAB = 'Yes'; // Use AntiBan, Yes or No
    Startplayer = 0; // Player that starts
    Tolerance = 3; // Tolerance for the monster colours
    waittime = 2; // How long in seconds do you want to wait inbetween clicking on each rock
    range = 725; // A random number, between 500 and 1000

    //---------------------------Do not touch below---------------------------\\

    var
    Mvar, Mlvl, Color1, Color2, Color3, Min3d, LoadCount, SkillTimer, TabTimer, ab, z:integer;
    Dx, Dy, Gasses, exp, xp, TotalOres, TotalXP:integer;

    procedure OrezColorz;
    begin
    Mvar := -1;
    exp := 0;
    a := 0;
    TotalOres := 0;
    LoadCount := 0;
    if (RockName = 'Tin') then
    begin
    Color1 := 8421514;
    Color2 := 7960962;
    Color3 := 5000274;
    exp := 17;
    end
    if (RockName = 'Copper') then
    begin
    Color1 := 8618893;
    Color2 := 4483988;
    Color3 := 4417422;
    exp := 17;
    end
    if (RockName = 'Iron') then
    begin
    Color1 := 1317933;
    Color2 := 2305870;
    Color3 := 1844542;
    exp := 35;
    end
    end;

    procedure report;
    begin
    TotalXP := TotalOres * exp;
    SRLRandomsReport;
    if (Mvar = -1) then
    begin
    GetSkillLevel('Mining');
    Mlvl := GetSkillLevel('Mining');
    end
    writeln('+-----------------------------------------------]');
    writeln('| Magic Johnson'#39' Rock Smasher');
    writeln('| Worked for '+ TimeRunning);
    writeln('| Mined and dropped ' + IntToStr(TotalOres) + ' ' + RockName + ' ores');
    writeln('| Gained ' + IntToStr(totalxp) + ' mining xp');
    writeln('| Your mining level is now ' + IntToStr(Mlvl));
    writeln('| Avoided Gas ' + IntToStr(Gasses) + ' times');
    writeln('+-----------------------------------------------]');
    end;

    Function LogOutEveryM(mins, forxmins: Integer):Boolean;
    var
    Mark: Integer;
    begin
    if ((TimeFromMark(LogOutMark) / 1000) / 60 >= mins) then
    begin
    MarkTime(LogOutMark);
    MMouse(Random(500), -10, 0, 0)
    Logout;
    WriteLn('Logging out and coming back in about ' + IntToStr(forxmins) +
    ' min(s)');
    MarkTime(Mark);
    repeat
    MMouse(0, 0, 100, 100)
    Wait(90000 + Random(1000));
    Wait(15 + Random(15) + Random(15))
    until (TimeFromMark(Mark) >= forxmins);
    Wait(Random(30000) + Random(30000));
    LoginPlayer;
    Wait(Random(15000) + Random(15000));
    end;
    end;

    procedure ranz;
    begin
    GetMousePos(Dx, Dy);
    OreColor := GetColor(Dx, Dy);
    If FindGas(Dx, Dy - 20) Then
    Begin
    FTWait(40);
    Gasses := Gasses + +1;
    ReportVars[3] := ReportVars[3] + 1;
    WriteLn('Gas Found.');
    Exit;
    End;
    SetScreenName(Players[0].Name);
    Findtalk;
    if (FindTalk = true) then
    begin
    SolveTalkingRandom('Talk to');
    end
    FindNormalRandoms;
    FindFight;
    if (FindFight = true) then
    begin
    RunWhere(RunDirection, true);
    end
    FindPick;
    LogOutEveryM(mins + random(ranmins), forxmins+random(ranlmins));
    if (NoPick = True) then
    begin
    writeln('The script failed to avoid gas... Logging out');
    LogOut;
    NextPlayer(True);
    end
    if (not(LoggedIn)) then
    begin
    NextPlayer(True);
    end
    end;

    procedure RandomTab;
    begin
    MarkTime(TabTimer);
    repeat
    if TimeFromMark(TabTimer) > 2000 then
    begin
    ranz;
    Wait(600+random(500))
    Gametab(1+random(12))
    MarkTime(Tabtimer);
    end else Wait(500);
    until false;
    end;

    procedure SkillCheck;
    begin
    z := random(3);
    if z = 0 then
    begin
    ranz;
    writeln('Checking skill... Mining');
    HoverSkill('Mining',false);
    GetSkillLevel('Mining');
    Mlvl := GetSkillLevel('Mining');
    end
    if z = 1 then
    begin
    ranz;
    writeln('Checking skill... Smithing');
    HoverSkill('Smithing',false);
    end
    if z = 2 then
    begin
    ranz;
    writeln('Checking skills... Mining & Smithing');
    HoverSkill('Mining',false);
    wait(1000 + random(500));
    HoverSkill('Smithing',false);
    end
    end;

    procedure DeclarePlayers;
    begin

    HowManyPlayers := 1;
    NumberOfPlayers(howmanyplayers);
    CurrentPlayer := StartPlayer;

    Players[0].Name :='user'; // Name
    Players[0].Pass :='pass'; // Pass
    Players[0].Nick := 'nik'; // About 3 letters of ur name
    Players[0].Active := True;

    writeln('Using '+inttostr(howmanyplayers)+' player');
    end;

    function FindDatRok(Color1, Color2, Color3, Tolerance: Integer; RockName: String): Boolean;
    var
    i, x, y: Integer;
    begin
    FFlag(5);
    for i:= 1 to 5 do
    begin
    if(FindColorTolerance(x, y, Color1, MSX1, MSY1, MSX2, MSY2, Tolerance + i))and
    (FindColorTolerance(x, y, Color2, MSX1, MSY1, MSX2, MSY2, Tolerance + i))and
    (FindColorTolerance(x, y, Color3, MSX1, MSY1, MSX2, MSY2, Tolerance + i))then
    begin
    MMouse(x, y, 3, 3);
    wait(80 + random(60));
    if(IsUpText('Mine Rocks'))then
    begin
    result := true;
    GetMousePos(x, y);
    Mouse(x, y, 0, 0, true);
    wait(40 + random(20));
    FFlag(5);
    wait((waittime*1000)+random(range));
    exit;
    end;
    end;
    end;
    end;

    procedure MineDemRox;
    begin
    Repeat;
    Mvar := Mvar + 1;
    MarkTime(TabTimer);
    MarkTime(SkillTimer);
    ranz;
    FindDatRok(Color1, Color2, Color3, Tolerance, RockName);
    Report;
    ranz;
    wait(1000+Random(550));
    if TimeFromMark(SkillTimer) > 30000 then
    begin
    Wait(1000+random(500))
    SkillCheck;
    End;

    if TimeFromMark(TabTimer) > 25000 then
    begin
    Wait(1000+random(500))
    Gametab(1+random(12))
    end;

    If (InvFull = true) then
    begin
    ranz;
    TotalOres := TotalOres + 28;
    DropAll;
    ranz;
    end

    ranz;

    if (UAB = 'Yes') then
    begin
    AntiBan;
    end

    until(LoadCount >= HMD);
    end;

    begin
    OrezColorz;
    ClearDebug;
    SetupSRL;
    SetupSRLMining;
    LoadMiningBitMaps;
    Declareplayers;
    loginplayer;
    FindPickHeadColor;
    MineDemRox;
    Logout;
    end.
     
  3. Unread #2 - Mar 7, 2007 at 10:12 AM
  4. Gofez0r
    Joined:
    Jan 21, 2007
    Posts:
    1,820
    Referrals:
    1
    Sythe Gold:
    0

    Gofez0r Guru

    [SRL] Magic Johnson's Rock Smasher [SRL]

    I doubt u made this... But if u did u should put indents to it and wrap code tags around the text... Oh well, i put indents to it for u.. I can remove this if u want, its just easier to read when theres some spaces too :p .. I used a pascal formatter for the indents.

    Code:
    
    {.Script Info:
    # ScriptName = Magic Johnson's Rock Smasher
    # Author = Magic Johnson
    # Description = An awesome powerminer
    # Version = 0.01
    /Script Info}
    
    program RockSmasher;
    {.include srl/srl.scar}
    {.include srl/srl/skill/mining.scar}
    {.include SRL\SRL\Misc\Trade.scar}
    
    {Setup lines 16 - 28 and Players Array is lines 163 - 165}
    
    const
      HMD = 10000; // How many loads to mine then drop
      mins = 15; // Log out every how many mins?
      forxmins = 3; // Stay logged out for how many mins?
      ranmins = 10; // Random mins to be added to mins
      ranlmins = 3; // Random mins to be added to forxmins
      RunDirection = 'N'; // Run away direction
      Rockname = 'Copper'; // The name of the rock you are mining
      UAB = 'Yes'; // Use AntiBan, Yes or No
      Startplayer = 0; // Player that starts
      Tolerance = 3; // Tolerance for the monster colours
      waittime = 2;
        // How long in seconds do you want to wait inbetween clicking on each rock
      range = 725; // A random number, between 500 and 1000
    
      //---------------------------Do not touch below---------------------------\\
    
    var
      Mvar, Mlvl, Color1, Color2, Color3, Min3d, LoadCount, SkillTimer, TabTimer,
        ab, z: integer;
      Dx, Dy, Gasses, exp, xp, TotalOres, TotalXP: integer;
    
    procedure OrezColorz;
    begin
      Mvar := -1;
      exp := 0;
      a := 0;
      TotalOres := 0;
      LoadCount := 0;
      if (RockName = 'Tin') then
      begin
        Color1 := 8421514;
        Color2 := 7960962;
        Color3 := 5000274;
        exp := 17;
      end
        if (RockName = 'Copper') then
        begin
          Color1 := 8618893;
          Color2 := 4483988;
          Color3 := 4417422;
          exp := 17;
        end
          if (RockName = 'Iron') then
          begin
            Color1 := 1317933;
            Color2 := 2305870;
            Color3 := 1844542;
            exp := 35;
          end
    end;
    
    procedure report;
    begin
      TotalXP := TotalOres * exp;
      SRLRandomsReport;
      if (Mvar = -1) then
      begin
        GetSkillLevel('Mining');
        Mlvl := GetSkillLevel('Mining');
      end
        writeln('+-----------------------------------------------]');
      writeln('| Magic Johnson'#39' Rock Smasher');
      writeln('| Worked for ' + TimeRunning);
      writeln('| Mined and dropped ' + IntToStr(TotalOres) + ' ' + RockName +
        ' ores');
      writeln('| Gained ' + IntToStr(totalxp) + ' mining xp');
      writeln('| Your mining level is now ' + IntToStr(Mlvl));
      writeln('| Avoided Gas ' + IntToStr(Gasses) + ' times');
      writeln('+-----------------------------------------------]');
    end;
    
    function LogOutEveryM(mins, forxmins: Integer): Boolean;
    var
      Mark: Integer;
    begin
      if ((TimeFromMark(LogOutMark) / 1000) / 60 >= mins) then
      begin
        MarkTime(LogOutMark);
        MMouse(Random(500), -10, 0, 0)
          Logout;
        WriteLn('Logging out and coming back in about ' + IntToStr(forxmins) +
          ' min(s)');
        MarkTime(Mark);
        repeat
          MMouse(0, 0, 100, 100)
            Wait(90000 + Random(1000));
          Wait(15 + Random(15) + Random(15))
        until (TimeFromMark(Mark) >= forxmins);
        Wait(Random(30000) + Random(30000));
        LoginPlayer;
        Wait(Random(15000) + Random(15000));
      end;
    end;
    
    procedure ranz;
    begin
      GetMousePos(Dx, Dy);
      OreColor := GetColor(Dx, Dy);
      if FindGas(Dx, Dy - 20) then
      begin
        FTWait(40);
        Gasses := Gasses + +1;
        ReportVars[3] := ReportVars[3] + 1;
        WriteLn('Gas Found.');
        Exit;
      end;
      SetScreenName(Players[0].Name);
      Findtalk;
      if (FindTalk = true) then
      begin
        SolveTalkingRandom('Talk to');
      end
        FindNormalRandoms;
      FindFight;
      if (FindFight = true) then
      begin
        RunWhere(RunDirection, true);
      end
        FindPick;
      LogOutEveryM(mins + random(ranmins), forxmins + random(ranlmins));
      if (NoPick = True) then
      begin
        writeln('The script failed to avoid gas... Logging out');
        LogOut;
        NextPlayer(True);
      end
        if (not (LoggedIn)) then
        begin
          NextPlayer(True);
        end
    end;
    
    procedure RandomTab;
    begin
      MarkTime(TabTimer);
      repeat
        if TimeFromMark(TabTimer) > 2000 then
        begin
          ranz;
          Wait(600 + random(500))
            Gametab(1 + random(12))
            MarkTime(Tabtimer);
        end
        else
          Wait(500);
      until false;
    end;
    
    procedure SkillCheck;
    begin
      z := random(3);
      if z = 0 then
      begin
        ranz;
        writeln('Checking skill... Mining');
        HoverSkill('Mining', false);
        GetSkillLevel('Mining');
        Mlvl := GetSkillLevel('Mining');
      end
        if z = 1 then
        begin
          ranz;
          writeln('Checking skill... Smithing');
          HoverSkill('Smithing', false);
        end
          if z = 2 then
          begin
            ranz;
            writeln('Checking skills... Mining & Smithing');
            HoverSkill('Mining', false);
            wait(1000 + random(500));
            HoverSkill('Smithing', false);
          end
    end;
    
    procedure DeclarePlayers;
    begin
    
      HowManyPlayers := 1;
      NumberOfPlayers(howmanyplayers);
      CurrentPlayer := StartPlayer;
    
      Players[0].Name := 'user'; // Name
      Players[0].Pass := 'pass'; // Pass
      Players[0].Nick := 'nik'; // About 3 letters of ur name
      Players[0].Active := True;
    
      writeln('Using ' + inttostr(howmanyplayers) + ' player[s]');
    end;
    
    function FindDatRok(Color1, Color2, Color3, Tolerance: Integer; RockName:
      string): Boolean;
    var
      i, x, y: Integer;
    begin
      FFlag(5);
      for i := 1 to 5 do
      begin
        if (FindColorTolerance(x, y, Color1, MSX1, MSY1, MSX2, MSY2, Tolerance + i))
          and
          (FindColorTolerance(x, y, Color2, MSX1, MSY1, MSX2, MSY2, Tolerance + i))
            and
          (FindColorTolerance(x, y, Color3, MSX1, MSY1, MSX2, MSY2, Tolerance + i))
            then
        begin
          MMouse(x, y, 3, 3);
          wait(80 + random(60));
          if (IsUpText('Mine Rocks')) then
          begin
            result := true;
            GetMousePos(x, y);
            Mouse(x, y, 0, 0, true);
            wait(40 + random(20));
            FFlag(5);
            wait((waittime * 1000) + random(range));
            exit;
          end;
        end;
      end;
    end;
    
    procedure MineDemRox;
    begin
      repeat;
        Mvar := Mvar + 1;
        MarkTime(TabTimer);
        MarkTime(SkillTimer);
        ranz;
        FindDatRok(Color1, Color2, Color3, Tolerance, RockName);
        Report;
        ranz;
        wait(1000 + Random(550));
        if TimeFromMark(SkillTimer) > 30000 then
        begin
          Wait(1000 + random(500))
            SkillCheck;
        end;
    
        if TimeFromMark(TabTimer) > 25000 then
        begin
          Wait(1000 + random(500))
            Gametab(1 + random(12))
        end;
    
        if (InvFull = true) then
        begin
          ranz;
          TotalOres := TotalOres + 28;
          DropAll;
          ranz;
        end
    
          ranz;
    
        if (UAB = 'Yes') then
        begin
          AntiBan;
        end
    
      until (LoadCount >= HMD);
    end;
    
    begin
      OrezColorz;
      ClearDebug;
      SetupSRL;
      SetupSRLMining;
      LoadMiningBitMaps;
      Declareplayers;
      loginplayer;
      FindPickHeadColor;
      MineDemRox;
      Logout;
    end.
    
     
  5. Unread #3 - Mar 8, 2007 at 7:18 AM
  6. Magic Johnson
    Joined:
    Mar 6, 2007
    Posts:
    504
    Referrals:
    2
    Sythe Gold:
    0

    Magic Johnson Forum Addict
    Banned

    [SRL] Magic Johnson's Rock Smasher [SRL]

    fyi, I DID write this script.
     
  7. Unread #4 - Mar 8, 2007 at 9:53 AM
  8. 1337Snak3
    Referrals:
    0

    1337Snak3 Guest

    [SRL] Magic Johnson's Rock Smasher [SRL]

    Umm, The declare players should be the first procedure so its easier to find.
    instead of huge const, add things like the staying logged out times to the player
    variables .
    Feel free to look from my clarion v0.5

    If its ur first, it rocks.
     
  9. Unread #5 - Mar 8, 2007 at 10:02 AM
  10. WinterDreamZ3
    Joined:
    Feb 22, 2007
    Posts:
    1,024
    Referrals:
    0
    Sythe Gold:
    0

    WinterDreamZ3 Guru
    Banned

    [SRL] Magic Johnson's Rock Smasher [SRL]

    And you don't know how to use a code box? L.O.L.
     
  11. Unread #6 - Mar 8, 2007 at 9:48 PM
  12. Magic Johnson
    Joined:
    Mar 6, 2007
    Posts:
    504
    Referrals:
    2
    Sythe Gold:
    0

    Magic Johnson Forum Addict
    Banned

    [SRL] Magic Johnson's Rock Smasher [SRL]

    I have never heard the term "code box" before
     
  13. Unread #7 - Mar 8, 2007 at 10:15 PM
  14. Town
    Joined:
    Jan 21, 2007
    Posts:
    3,776
    Referrals:
    3
    Sythe Gold:
    5

    Town Grand Master
    Scar Programmers

    [SRL] Magic Johnson's Rock Smasher [SRL]

    It's like a quote, except it is used for coding. I see no reason why this couldn't be your script and I see no reason to assume that it is not, it is nice to see a new scripter in the comminity.
     
  15. Unread #8 - Mar 10, 2007 at 8:33 AM
  16. Gofez0r
    Joined:
    Jan 21, 2007
    Posts:
    1,820
    Referrals:
    1
    Sythe Gold:
    0

    Gofez0r Guru

    [SRL] Magic Johnson's Rock Smasher [SRL]

    Well... He had 1 post and didnt know how to use code tags.. And town, has ur cutter been verified?
     
  17. Unread #9 - Mar 11, 2007 at 8:57 AM
  18. Magic Johnson
    Joined:
    Mar 6, 2007
    Posts:
    504
    Referrals:
    2
    Sythe Gold:
    0

    Magic Johnson Forum Addict
    Banned

    [SRL] Magic Johnson's Rock Smasher [SRL]

    Thanks
     
  19. Unread #10 - Mar 11, 2007 at 9:16 AM
  20. Town
    Joined:
    Jan 21, 2007
    Posts:
    3,776
    Referrals:
    3
    Sythe Gold:
    5

    Town Grand Master
    Scar Programmers

    [SRL] Magic Johnson's Rock Smasher [SRL]

    No, I E-Mailed it to StarBlaster but never got a message back :(
     
  21. Unread #11 - Mar 11, 2007 at 5:38 PM
  22. Nuice
    Joined:
    Mar 10, 2007
    Posts:
    118
    Referrals:
    0
    Sythe Gold:
    0

    Nuice Active Member

    [SRL] Magic Johnson's Rock Smasher [SRL]

    hey umm i run the script in scar and it says ... Running Script. but my guy doesnt do anything does anybody know why
     
  23. Unread #12 - Jul 25, 2007 at 2:16 AM
  24. Evocoderxx
    Joined:
    Jan 21, 2007
    Posts:
    743
    Referrals:
    2
    Sythe Gold:
    0

    Evocoderxx Apprentice
    Banned

    [SRL] Magic Johnson's Rock Smasher [SRL]

    Looks alright except it uses old includes? Or did i read that wrong. And wrap in a code box?
     
< Death rune buyer with world Switcher!!! | Bomb's OldSchool Tokkul Arena Completer! >

Users viewing this thread
1 guest


 
 
Adblock breaks this site