Results 1 to 5 of 5

Thread: Been away a while, need some help.

  1. #1
    Join Date
    Feb 2007
    Location
    Access Violation at 0x00000000
    Posts
    2,865
    Mentioned
    3 Post(s)
    Quoted
    18 Post(s)

    Default Been away a while, need some help.

    Hey everybody.
    I'm sure you won't remember me but I once was a dedicated SRL forums member :P
    Well, I've been writing a sort of script that would let people train ON me.

    I've got SCAR 3.15 and rev #20. (Yeah old).
    But I don't mind that I'm not fully up-to-date.

    SCAR Code:
    program New;
    {.include SRL\SRL.scar}
    {.include SRL\SRL\skill\Fighting.scar}

    var CurrHP, HPLvl       : Integer;
        Color               : string;

    const
         MinHP              = 52; //HP to eat at!

    function Eat(uptext: string): Boolean;
    var I           : Integer;
        K           : TPoint;
    begin
    GameTab(4);
    I := 1;
    repeat
    CurrHP := getMMLevels('hp', color);
    WriteLn(IntToStr(I));
    begin
    K := ItemCoords(I);
     if (IsUpText(uptext)) then
      begin
       MoveMouse(K.X, K.Y);
        ClickMouse(K.X, K.Y, true);
        I := I + 1;
       Wait(250);
      end else I := I + 1;
    end;
    until(CurrHP = HPLvl);
    Result := true;
    end;

    function CheckFood: Boolean;
    var K, I : Integer;
    begin
    if (InvCount = 0) then
    begin
     K := 28 - InvCount;
     K := K / 2;
     K := round(K);
      repeat
       SendKeys('::food'+Chr(13));
        Wait(10+random(10));
       I := I + 1;
      until(I = K);
    end;
     Result := true;
    end;

    begin
    SetupSRL;
    ActivateClient;
    Wait(1000);
    HPLvl := getSkillLevel('hitpoints');
    repeat
    begin
    CurrHP := getMMLevels('hp', color);
      if (CurrHP <= MinHP) or (Color = 'orange') then
      begin
       WriteLn('Your current HP: '+ IntToStr(CurrHP) +', time to eat!');
       Eat('ray');
      end;
      CurrHP := getMMLevels('hp', 'green');
      CheckFood;
     Wait(1500);
    end;
    until(IsFKeyDown(1));
    end.

    Please don't mind the sloppy code.
    But it just doesn't do what it needs to do:
    Eat the next Manta ray in the inventory when the HP is below 'Maxx'.

    If you really want to know, it's not for the official RS.

    Thanks.
    Ce ne sont que des gueux


  2. #2
    Join Date
    Mar 2008
    Location
    ::1
    Posts
    915
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    If it doesn't do what it's supposed to, then what does it do? Knowing that will help me solve your problem. I did notice that you didn't set hp to anything until the line after you use it..
    This...
    SCAR Code:
    WriteLn('Your current HP: '+ IntToStr(hp));
    hp := getMMLevels('hp', 'green');
    ... should be changed to this.
    SCAR Code:
    hp := getMMLevels('hp', 'green');
    WriteLn('Your current HP: '+ IntToStr(hp));

    Also, you are using getMMLevels in the incorrect way. The second argument should be a string variable in your script. getMMLevels will store the color of the hp in that string. Here's an example...
    SCAR Code:
    procedure Example;
    var
      hpString: String;
    begin
      getMMLevels('hp', hpString);
      if(hpString == 'red') then
      begin
        Writeln('You are in bad health! :D');
      end;
    end;

    I don't think this is a big deal since you said it's not for the real rs, but you are currently using MoveMouse, ClickMouse, and SendKeys, when you could/should be using MMouse, Mouse and TypeSend respectively.
    Post if you need any further help!

    Records and Types Save Code (and make you look better)
    Quote Originally Posted by Wizzup? View Post
    Is it possible to make Runescape a 2D game with this?... That would greatly simplify... Just about anything.

  3. #3
    Join Date
    Oct 2008
    Posts
    0
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    umm. so what exactly do you need help with

  4. #4
    Join Date
    May 2007
    Location
    Seattle
    Posts
    1,069
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by XxChillinwithmahGnomiesxX View Post
    umm. so what exactly do you need help with
    Spam.

    He needs help bringing his script up to date with current SRL.
    FORMERLY BORN2CODE | Play Internet Games
    http://img147.imageshack.us/img147/2084/sigg.png

  5. #5
    Join Date
    Feb 2007
    Location
    Access Violation at 0x00000000
    Posts
    2,865
    Mentioned
    3 Post(s)
    Quoted
    18 Post(s)

    Default

    Nvm I fixed it by myself.
    I found it too dirty looking :P
    I also found out I didn't have the correct getMMLevel parameters
    Ce ne sont que des gueux


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
  •