Results 1 to 2 of 2

Thread: Script wont find TMSObject

  1. #1
    Join Date
    May 2012
    Posts
    9
    Mentioned
    0 Post(s)
    Quoted
    4 Post(s)

    Default Script wont find TMSObject

    Hi, I've been trying to make a simple script on one of the pservers, but it wouldn't click on object. I made couple scripts on other pserver and was using TMSObjects functions to find and click on the object i need. Everything would work fine, finds an object, checks if the uptext is correct and then would click it. Now when I've tried to make a similar script on other server, using same functions. It finds the color, moves the mouse to the object, but would not click it and keeps on looking for the object, because the uptext didnt match I guess? I made a procedure to check if it can find a tree, but it does not.

    Code:
    program new;
    {$i AeroLib/AeroLib.Simba}
    
    var
      YewTree: TMSObject;
    
    Procedure FindTree;
    var
      pnt:tpoint;
    begin
    if (not YewTree.Find(10, MSCP, pnt)) then
     wait(500);
      writeln('cannot find tree');
       exit;
      if YewTree.Find(10, MSCP, pnt) then
       writeln('tree found');
        FastClick(mouse_left);
    
    end;
    
    begin
    initAL;
    YewTree.create('Yew', ['down Yew', 'Chop down Yew'], [createCol(5542796, 15, 0.20, 1.40)]);
    FindTree;
    end;
    I checked the uptext color and its the same as other pserver. I checked client size on both servers when selecting client and when I try to select it, it selects the whole client with the whole top bar. So maybe thats why it cannot find the uptext?
    rs.png

  2. #2
    Join Date
    Jan 2012
    Location
    in a galaxy far far away
    Posts
    371
    Mentioned
    3 Post(s)
    Quoted
    48 Post(s)

    Default

    Quote Originally Posted by bl3d3 View Post
    Hi, I've been trying to make a simple script on one of the pservers, but it wouldn't click on object. I made couple scripts on other pserver and was using TMSObjects functions to find and click on the object i need. Everything would work fine, finds an object, checks if the uptext is correct and then would click it. Now when I've tried to make a similar script on other server, using same functions. It finds the color, moves the mouse to the object, but would not click it and keeps on looking for the object, because the uptext didnt match I guess? I made a procedure to check if it can find a tree, but it does not.

    Code:
    program new;
    {$i AeroLib/AeroLib.Simba}
    
    var
      YewTree: TMSObject;
    
    Procedure FindTree;
    var
      pnt:tpoint;
    begin
    if (not YewTree.Find(10, MSCP, pnt)) then
     wait(500);
      writeln('cannot find tree');
       exit;
      if YewTree.Find(10, MSCP, pnt) then
       writeln('tree found');
        FastClick(mouse_left);
    
    end;
    
    begin
    initAL;
    YewTree.create('Yew', ['down Yew', 'Chop down Yew'], [createCol(5542796, 15, 0.20, 1.40)]);
    FindTree;
    end;
    I checked the uptext color and its the same as other pserver. I checked client size on both servers when selecting client and when I try to select it, it selects the whole client with the whole top bar. So maybe thats why it cannot find the uptext?
    rs.png
    not 100% sure but try to select client without the top bar and also some rsps have different fonts in the uptext. im not fond of the tms object really but not sure if the code above is correct? i use simple simple simple things in my rsps scripts and 9/10 i can accomplish what im going for with a simple thing like this with a bit of tweaking i would try to get something easy working first then move onto more complicated things. this is just a very basic example of something ive used to do many many things even if there were better ways. the way i did it worked for me. and part of learning is starting somewhere and trying to improve

    Simba Code:
    procedure ClickNPC;  //clicks an npc or etc
    var                    
      x, y : integer;

    begin
      if FindColorTolerance(x, y, 1234567, x1, y1, x2, y2, tolerance) then     //npc color
      begin
        writeLn('found npc');
        MoveMouse(x, y);
        writeLn('moved mouse to npc');
        wait (100 + Random(100));
        ClickMouse(x, y, MOUSE_LEFT);
        wait (100 + Random(100));
        writeLn('clicked npc');
      end
    end; ps i dont take credit for this procedure
    Last edited by chief herb; 04-28-2020 at 09:13 AM.
    >:)

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
  •