Results 1 to 14 of 14

Thread: Help with reports/proggy's

  1. #1
    Join Date
    Jan 2012
    Location
    Calgary, AB, Canada
    Posts
    1,819
    Mentioned
    5 Post(s)
    Quoted
    120 Post(s)

    Default Help with reports/proggy's

    Hi, so i'm back (lol) and I can't seem to get reports working right, could someone make a guide for these or direct me too one?

    Here is an example of one of mine ( the xp counter doesn't work):

    Simba Code:
    procedure Report;
    var
    IvyChopped: integer;
    TotalEXP: integer;
    begin
      TotalEXP := (IvyChopped*333);

      Writeln('############ MegaIvyChopper ##########');
      Writeln('|= Player : ' + Players[CurrentPlayer].Name);
      Writeln('|= Time Running : ' + TimeRunning);
      Writeln('|= Xp gained : ' + IntToStr(TotalEXP));
      Writeln('######################################');
    end;

    Thank you for any help and guidance.
    Current Project: Retired

  2. #2
    Join Date
    Jan 2008
    Location
    C:\
    Posts
    1,483
    Mentioned
    2 Post(s)
    Quoted
    2 Post(s)

    Default

    Looks like it's an issue with your counter, not your report. Everything seems fine on the report

  3. #3
    Join Date
    Jan 2012
    Location
    Calgary, AB, Canada
    Posts
    1,819
    Mentioned
    5 Post(s)
    Quoted
    120 Post(s)

    Default

    But how come it's not working ;(
    Current Project: Retired

  4. #4
    Join Date
    Jan 2008
    Location
    C:\
    Posts
    1,483
    Mentioned
    2 Post(s)
    Quoted
    2 Post(s)

    Default

    Quote Originally Posted by mega284 View Post
    But how come it's not working ;(
    I will never be able to answer with the limited amount of code you posted :P

  5. #5
    Join Date
    Dec 2008
    Posts
    160
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Simba Code:
    If InvCount = +1 then IncEx(IvyChopped,1);
    make sure you have somthing like that in your script
    My Soul Wars Scipt Proggress:[100%....]
    Probably won't release though I like it for myself

  6. #6
    Join Date
    Feb 2011
    Location
    Earth
    Posts
    1,784
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by poopy2177 View Post
    Simba Code:
    If InvCount = +1 then IncEx(IvyChopped,1);
    make sure you have somthing like that in your script
    You can't use InvCount for Ivy, you will have to use the xp-bar or create something with the new xp animation.

    Currently: Working on Defending&Attacking in my Castle-Wars Script
    Project Rebuild: 90M/170M

  7. #7
    Join Date
    Jan 2012
    Location
    Calgary, AB, Canada
    Posts
    1,819
    Mentioned
    5 Post(s)
    Quoted
    120 Post(s)

    Default

    Code: Ignore the DTM parts I can't get those to work yet

    Simba Code:
    program MegaIvyChopper;
    {$DEFINE SMART}
    {$i srl/srl.simba}
    {$i sps/sps.simba}

    const
      SRLStats_User     = '';   // Your SRL Stats Username
      SRLStats_Password = '';   // Your SRL Stats Password
      SERVER            = 0;  // Enter "0" to pick a random server.
      MEMBERS           = True;
      NumbOfPlayers     = 1;
      StartPlayer       = 0;

    var
    IvyChopped, Ivy, TotalEXP, x, y: integer;
    aFound: Extended;

    procedure DeclarePlayers;
      var i:integer;
    begin
      NumberOfPlayers(NumbOfPlayers);
      CurrentPlayer := StartPlayer
      for i := 0 to NumbOfPlayers-1 do
        Players[i].BoxRewards := ['XP'];

      With Players[0] do
      begin
        Name := ''; //Username.
        Pass := ''; //Password.
        Active := True;
      end;

    end;

    function CheckAndClick (UpText, Option:String; x, y:Integer; RClick:Boolean):Boolean;
     begin
      MMouse(x, y, 6, 6);
      If WaitUpText(UpText, 1000+Random(200)) Then
      begin
        Result:=True;
        GetMousePos(x, y);
        If RClick Then
        begin
          Mouse(x, y, 0, 0, False);
          Result:= WaitOption(Option, 2000);
          If Result Then FFlag(0);
        end Else
        Begin
          Mouse(x, y, 0, 0, True);
          Wait(150+Random(100));
          FFlag(0);
        end;
      end;
    end;

    Function Cutting: Boolean;
      var
        PBox: TBox;
      begin
        PBox := IntToBox(250, 132, 279, 193);
        Result := (AveragePixelShift(PBox, 500, 800) > 425);
      end;

    function BirdNest: Boolean;
    var
    i, x, y: integer;
    begin
      if (Pos('A bird', GetChatBoxText(i, 255))<>0) then // Credit to Shuttleu for this line
        begin
          WriteLn('Found a Bird Nest');
          if FindObjCustom(x, y, ['ake Bird Nest', 'bird', 'nest'], [2767422, 2961972, 3818051], 10) then
          Mouse(x, y, 5, 5, True);
          end;
      end;

    procedure SetDTM;
    begin
    Ivy := DTMFromString('mrAAAAHic42BgYDgKxMeBeDcQnwTia0B8FYgPAPFGIK4B4nwo3QbE1UCcAMTzgbgDiMtmhjGEF9gzBGXZMHjFmzHEVbkwxFY4M2Ql2jAk1LgxEAKMBDAMAACfGxLL');

    end;

    procedure Report;
    var
    IvyChopped: integer;
    TotalEXP: integer;
    begin
      TotalEXP := (IvyChopped*333);

      Writeln('############ MegaIvyChopper ##########');
      Writeln('|= Player : ' + Players[CurrentPlayer].Name);
      Writeln('|= Time Running : ' + TimeRunning);
      Writeln('|= Xp gained : ' + IntToStr(TotalEXP));
      Writeln('######################################');
    end;

    procedure AntiBan;
    begin
      if(not(LoggedIn))then
      exit;
      FindNormalRandoms;
    case Random(2) of
      0:
    begin
      WriteLn('AntiBan Is Being Performed');
        HoverSkill('Woodcutting', false);
        wait(2500+Random(1000));
        Mouse(659, 189, 0, 0, True);
      end;
      1:
        begin
        WriteLn('Bored')
        If (Cutting) then
        BoredHuman;
     end;
    end;
    end;

    procedure CrashSMART;
    begin
      Writeln('You are using CRASHSMART, so we are going to reload your client after the RS update!');
      SmartgetFieldObject(1488,'crash');
      Wait(5000);
      WriteLn('CRASHSMART Failed: Make sure you are using the custom libsmart plugin');
      TerminateScript;
    end;

    procedure FreDTM;
    begin

      FreeDTM(Ivy);
    end;

    procedure IvyChopping;
    begin
      SetDTM;
      MakeCompass('N');
      SetAngle(SRL_ANGLE_LOW);
      wait(200+random(400));

      if (FindDTMRotated(Ivy, x, y, MSX1, MSY1, MSX2, MSY2, -Pi, Pi, Pi/30, aFound)) then
      begin
      Writeln('Ivy Has Been Found :)');
      Wait(10+random(20));
      Mouse(x,y,4,4,true)
      Wait(10+random(45));

      if (Cutting) then
      Antiban;

        end else Writeln('Cannot find Ivy');
       repeat
        wait(50+random(100));
      Until(Not Cutting);
    end;

    procedure FailSafe (Reason:String);
    begin
      Players[CurrentPlayer].Loc:=Reason;
      Logout;
      Stats_Commit;
      TerminateScript;
    end;

    begin
      Smart_Signed := TRUE;
      Smart_Members := MEMBERS;
      Smart_SuperDetail := FALSE;
      ActivateClient;
      Smart_Server := 30;
      SetupSRL;
      SetDTM;
      SRL_Procs[srl_OnRSUpdate] := @CrashSMART;
      DeclarePlayers;
        if not (LoggedIn) then
      LoginPlayer;
      wait(1000+random(400));
      Repeat
        IvyChopping;
        BirdNest;
        AntiBan;
        Report;
        FreDTM;
      Until(false);
    end.
    Current Project: Retired

  8. #8
    Join Date
    Jan 2012
    Location
    Calgary, AB, Canada
    Posts
    1,819
    Mentioned
    5 Post(s)
    Quoted
    120 Post(s)

    Default

    Quote Originally Posted by PatDuffy View Post
    You can't use InvCount for Ivy, you will have to use the xp-bar or create something with the new xp animation.
    OMG way too advanced for me
    Current Project: Retired

  9. #9
    Join Date
    Jan 2012
    Location
    Calgary, AB, Canada
    Posts
    1,819
    Mentioned
    5 Post(s)
    Quoted
    120 Post(s)

    Default

    anyone?
    Current Project: Retired

  10. #10
    Join Date
    Jan 2008
    Location
    C:\
    Posts
    1,483
    Mentioned
    2 Post(s)
    Quoted
    2 Post(s)

    Default

    Ok, the first issue is that you've declared IvyChopped twice. You want to use that integer globally, so remove it from here:

    Simba Code:
    procedure Report;
    var
    IvyChopped: integer;
    TotalEXP: integer;

    Second, you declare it but never give it a value. Normally you would give it a value by using the Inc() function which increases a variables value by 1, but with an ivy chopper that won't work.

    What you can do is use the function CountItems() which can search for an item in your inventory and return the amount of that item there is (very useful for counting stackables).

    Simply search at the beginning and store the value, then search during the report procedure and subtract the first value from the second. if you can't find the DTM then assume the value began is 0.

    Hopefully that helps
    Last edited by Runaway; 02-22-2012 at 03:24 AM.

  11. #11
    Join Date
    Jan 2012
    Location
    Calgary, AB, Canada
    Posts
    1,819
    Mentioned
    5 Post(s)
    Quoted
    120 Post(s)

    Default

    Quote Originally Posted by Runaway View Post
    Ok, the first issue is that you've declared IvyChopped twice. You want to use that integer globally, so remove it from here:

    Simba Code:
    procedure Report;
    var
    IvyChopped: integer;
    TotalEXP: integer;

    Second, you declare it but never give it a value. Normally you would give it a value by using the Inc() function which increases a variables value by 1, but with an ivy chopper that won't work.

    What you can do is use the function CountItems() which can search for an item in your inventory and return the amount of that item there is (very useful for counting stackables).

    Simply search at the beginning and store the value, then search during the report procedure and subtract the first value from the second. if you can't find the DTM then assume the value began is 0.

    Hopefully that helps
    But ivy doesn't go into the inventory when chopped
    Current Project: Retired

  12. #12
    Join Date
    Jan 2008
    Location
    C:\
    Posts
    1,483
    Mentioned
    2 Post(s)
    Quoted
    2 Post(s)

    Default

    Quote Originally Posted by mega284 View Post
    But ivy doesn't go into the inventory when chopped
    Well that was silly of me. I assumed it was a stackable item you'd be measuring

    What you can do instead is:

    Simba Code:
    var
      StartXp: integer; // Add this var to your globals declared at the top

    ...
    // Place this somewhere at the beginning of the script
      StartXp := GetXpBar(1);

    // I am not entirely sure what integer is used in the GetXpBar() function as
    // I've never used it, but if 1 does not work try tinkering with the value.
    ...

    procedure Report;
    var
      TotalEXP, CurrentXp: integer;
    begin
      CurrentXp := GetXpBar(1);
      TotalEXP := (CurrentXp - StartXp);

      Writeln('############ MegaIvyChopper ##########');
      Writeln('|= Player : ' + Players[CurrentPlayer].Name);
      Writeln('|= Time Running : ' + TimeRunning);
      Writeln('|= Xp gained : ' + IntToStr(TotalEXP));
      Writeln('######################################');
    end;

    This function will take the value of your Xp bar in the top right corner of the RS interface and store it in the StartXp variable. Then you can get the total amount of Xp gained by subtracting that from the current integer displayed on the Xp bar.
    Last edited by Runaway; 02-22-2012 at 07:21 AM.

  13. #13
    Join Date
    Jan 2012
    Location
    Calgary, AB, Canada
    Posts
    1,819
    Mentioned
    5 Post(s)
    Quoted
    120 Post(s)

    Default

    Thanks for helping
    Current Project: Retired

  14. #14
    Join Date
    Jan 2008
    Location
    C:\
    Posts
    1,483
    Mentioned
    2 Post(s)
    Quoted
    2 Post(s)

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
  •