Results 1 to 7 of 7

Thread: Graphical progress reports

  1. #1
    Join Date
    Feb 2009
    Posts
    484
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default Graphical progress reports



    Is there a complete guide or tutorial on how to make these on Simba?

    I remember every script in RSBuddy, Nexus or RSBot had one, yet they are so rare on scripts here? Why is this, are scripters just too lazy or something or are they actually much harder.

    I've got no idea, tell me.

  2. #2
    Join Date
    Jan 2010
    Posts
    1,414
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

  3. #3
    Join Date
    Aug 2007
    Location
    in a random little world
    Posts
    5,778
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

    Default

    i have one in my scripts

    here is the code

    Simba Code:
    Procedure PrintOnSmart(TP: TStringArray; Placement: TPoint; Colour: integer);
    var
      mx, my, Pic, I, B, H, TPH, Numb: Integer;
      TTP: TPointArray;
      Canvas: TCanvas;
    begin
      SmartSetDebug(True);
      GetClientDimensions(mx, my);
      Pic := BitmapFromString(mx, my, '');
      TPH := High(TP);
      for I := 0 to TPH do
      begin
        TTP := LoadTextTPA(TP[i], SmallChars, H);
        for B := 0 to High(TTP) do
        begin
          Numb := ((I + 1) * 13);
          FastSetPixel(Pic, TTP[b].x + 1, TTP[b].y + Numb + 1,131072);
          FastSetPixel(Pic, TTP[b].x, TTP[b].y + Numb, Colour);
        end;
      end;
      Canvas := TCANVAS.Create;
      Canvas.Handle := SmartGetDebugDC;
      DrawBitmap(Pic, Canvas, Placement.x, Placement.y);
      FreeBitmap(Pic);
    end;

    Procedure OnScreen;
    Var
      h, m, s, TempExp: Integer;
      SmartLines: TStringArray;
    begin
      TempExp:= GetXPBarTotal;

      if Debug then
        Writeln(TempExp);
      Players[CurrentPlayer].Integers[9]:= TempExp;
      ConvertTime(TimeFromMark(ScriptStarted), h, m, s);

      SetArrayLength(SmartLines, 7);

      SmartLines[0]:= 'Running time: '+PadZ(IntToStr(h), 2)+':'+PadZ(IntToStr(m), 2)+':'+PadZ(IntToStr(s), 2);
      SmartLines[1]:= 'Woodcutting Level: '+IntToStr(Players[CurrentPlayer].Integers[2]);
      SmartLines[2]:= 'Vines Chopped: '+IntToStr((Players[CurrentPlayer].Integers[9]-Players[CurrentPlayer].Integers[1])/332);
      SmartLines[3]:= 'Levels Gained: '+IntToStr(Players[CurrentPlayer].Integers[10]-Players[CurrentPlayer].Integers[2]);
      SmartLines[4]:= 'Experience Gained: '+IntToStr(Players[CurrentPlayer].Integers[9]-Players[CurrentPlayer].Integers[1]);
      SmartLines[5]:= 'Experience/hr: '+IntToStr(round((Players[CurrentPlayer].Integers[9]-Players[CurrentPlayer].Integers[1])/ (h * 1.0 + m / 60.0 + s / 3600.0)));
      SmartLines[6]:= 'Birds Nests: '+IntToStr(Players[CurrentPlayer].Integers[3]);

      PrintOnSmart(['~Vine Vanquisher '+ScriptVersion+' (by Shuttleu)~'],Point(15,20),65280);
      PrintOnSmart(SmartLines,Point(10,50),clWhite);

    end;
    just edit that as you need

    ~shut

  4. #4
    Join Date
    Feb 2009
    Posts
    484
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by Shuttleu View Post
    i have one in my scripts

    here is the code

    Simba Code:
    Procedure PrintOnSmart(TP: TStringArray; Placement: TPoint; Colour: integer);
    var
      mx, my, Pic, I, B, H, TPH, Numb: Integer;
      TTP: TPointArray;
      Canvas: TCanvas;
    begin
      SmartSetDebug(True);
      GetClientDimensions(mx, my);
      Pic := BitmapFromString(mx, my, '');
      TPH := High(TP);
      for I := 0 to TPH do
      begin
        TTP := LoadTextTPA(TP[i], SmallChars, H);
        for B := 0 to High(TTP) do
        begin
          Numb := ((I + 1) * 13);
          FastSetPixel(Pic, TTP[b].x + 1, TTP[b].y + Numb + 1,131072);
          FastSetPixel(Pic, TTP[b].x, TTP[b].y + Numb, Colour);
        end;
      end;
      Canvas := TCANVAS.Create;
      Canvas.Handle := SmartGetDebugDC;
      DrawBitmap(Pic, Canvas, Placement.x, Placement.y);
      FreeBitmap(Pic);
    end;

    Procedure OnScreen;
    Var
      h, m, s, TempExp: Integer;
      SmartLines: TStringArray;
    begin
      TempExp:= GetXPBarTotal;

      if Debug then
        Writeln(TempExp);
      Players[CurrentPlayer].Integers[9]:= TempExp;
      ConvertTime(TimeFromMark(ScriptStarted), h, m, s);

      SetArrayLength(SmartLines, 7);

      SmartLines[0]:= 'Running time: '+PadZ(IntToStr(h), 2)+':'+PadZ(IntToStr(m), 2)+':'+PadZ(IntToStr(s), 2);
      SmartLines[1]:= 'Woodcutting Level: '+IntToStr(Players[CurrentPlayer].Integers[2]);
      SmartLines[2]:= 'Vines Chopped: '+IntToStr((Players[CurrentPlayer].Integers[9]-Players[CurrentPlayer].Integers[1])/332);
      SmartLines[3]:= 'Levels Gained: '+IntToStr(Players[CurrentPlayer].Integers[10]-Players[CurrentPlayer].Integers[2]);
      SmartLines[4]:= 'Experience Gained: '+IntToStr(Players[CurrentPlayer].Integers[9]-Players[CurrentPlayer].Integers[1]);
      SmartLines[5]:= 'Experience/hr: '+IntToStr(round((Players[CurrentPlayer].Integers[9]-Players[CurrentPlayer].Integers[1])/ (h * 1.0 + m / 60.0 + s / 3600.0)));
      SmartLines[6]:= 'Birds Nests: '+IntToStr(Players[CurrentPlayer].Integers[3]);

      PrintOnSmart(['~Vine Vanquisher '+ScriptVersion+' (by Shuttleu)~'],Point(15,20),65280);
      PrintOnSmart(SmartLines,Point(10,50),clWhite);

    end;
    just edit that as you need

    ~shut
    Thank you guys. Very quick replies indeed.

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

    Default

    Pssst Shut, care to add comments to yours to show what exactly everything does?

    I know how to make the simple ones, but I would be interested to start using more detailed ones to make my scripts more smexi.

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

  6. #6
    Join Date
    Aug 2007
    Location
    in a random little world
    Posts
    5,778
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

    Default

    sure

    Simba Code:
    Procedure PrintOnSmart(TP: TStringArray; Placement: TPoint; Colour: integer);
    var
      mx, my, Pic, I, B, H, TPH, Numb: Integer;
      TTP: TPointArray;
      Canvas: TCanvas;
    begin
      SmartSetDebug(True);
      GetClientDimensions(mx, my);
      Pic := BitmapFromString(mx, my, '');
      TPH := High(TP);
      for I := 0 to TPH do
      begin
        TTP := LoadTextTPA(TP[i], SmallChars, H);
        for B := 0 to High(TTP) do
        begin
          Numb := ((I + 1) * 13);
          FastSetPixel(Pic, TTP[b].x + 1, TTP[b].y + Numb + 1,131072);
          FastSetPixel(Pic, TTP[b].x, TTP[b].y + Numb, Colour);
        end;
      end;
      Canvas := TCANVAS.Create;
      Canvas.Handle := SmartGetDebugDC;
      DrawBitmap(Pic, Canvas, Placement.x, Placement.y);
      FreeBitmap(Pic);
    end;

    // Dont need to worry about this above

    Procedure OnScreen;
      SmartLines: TStringArray;
    begin

      SetArrayLength(SmartLines, 7);   // sets how many lines to write

      SmartLines[0]:= 'Line 1';
      SmartLines[1]:= 'Line 2';
      SmartLines[2]:= 'Line 3';
      SmartLines[3]:= 'Line 4';
      SmartLines[4]:= 'Line 5';
      SmartLines[5]:= 'Line 6';
      SmartLines[6]:= 'Line 7';
      //these are what to write on the lines

      PrintOnSmart(['Title'],Point(15,20),65280);             // title line
      PrintOnSmart(SmartLines,Point(10,50),clWhite);       // lines set above

    end;

    ~shut

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

    Default

    Ahhh, I'm going to also take a quick look at Flight's Naturez to see how to print a picture.

    That was actually much more effective than the way I was doing it.

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

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
  •