Results 1 to 14 of 14

Thread: Checking if monster has spawned.

  1. #1
    Join Date
    Feb 2012
    Posts
    46
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Checking if monster has spawned.

    So, I was working on a script again after quitting after I got frustrated, and I just can't figure out how to do it, spent hours looking through scripts and tuts for the solution (maybe I'm not looking at the right thing).

    I need my mouse to wait for an npc to spawn and then attack, basically my mouse goes nuts looking everywhere for the npc color (using ACA) and doesn't wait for the monster to respawn. I posted a while ago about this, and I got replies saying to use waittimeuntil, or some command like that. I really couldn't figure it out. I really tried but failed.

    Stuff i've done to fix the problem:
    -put a delay in (really unefficient, sometimes goes on waiting even after the monster the spawn, sometimes clicks too early and then another wait)
    -put a boolean statement to check if the monsters there. (way too inexperienced in simba to even get that functioning)

    I have programmed in other languages, so even a little guidance may help, I'm just very new to simba.

    Thanks.

  2. #2
    Join Date
    Feb 2012
    Posts
    46
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Sorry, realised afterwards i posted in wrong section (probably because my mind is fried). Any mod want to move it for me please.

  3. #3
    Join Date
    Jan 2009
    Location
    Turlock/LA, California
    Posts
    1,494
    Mentioned
    3 Post(s)
    Quoted
    66 Post(s)

    Default

    i can help u over skype / team viewer if you want.

  4. #4
    Join Date
    Feb 2012
    Posts
    46
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    ah, don't have either. I can post my noobish standard script here if you can help like that.

  5. #5
    Join Date
    Jan 2009
    Location
    Turlock/LA, California
    Posts
    1,494
    Mentioned
    3 Post(s)
    Quoted
    66 Post(s)

    Default

    well the issue is that u are sorta vague. wat npc, where?

  6. #6
    Join Date
    Feb 2012
    Posts
    46
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Lesser Demon, Wizard's Tower. It's really a first script I thought would be easy to tackle.. it's not meant to really get stats or cash, just a practice script.

  7. #7
    Join Date
    Oct 2006
    Location
    Netherlands
    Posts
    3,285
    Mentioned
    105 Post(s)
    Quoted
    494 Post(s)

    Default

    Just check for the yellow color on the minimap. If it appears in the cage. Then search for the npc on screen.
    Working on: Tithe Farmer

  8. #8
    Join Date
    Jan 2009
    Location
    Turlock/LA, California
    Posts
    1,494
    Mentioned
    3 Post(s)
    Quoted
    66 Post(s)

    Default

    one sec, i am movin my character there . i will update this post with a solution.

    edit: yup do wat masterbb said. i would check for the yellow in the area below the character (mmcy(-5)->mmy2). then if you wanted u could also chekc the color of the demon with an atpa (with uptext).

    edit2:
    Code:
      if(findcolortolerance(x,y,60899,mmx1,mmcy+5,mmx2,mmy2,5))then
        writeln('demon found');
    Last edited by x[Warrior]x3500; 03-11-2012 at 10:56 PM.

  9. #9
    Join Date
    Feb 2012
    Posts
    46
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I understand what you guys are saying. When looking for that yellow dot, wouldn't it get confused with the other wizard thats on the top floor. Not logged in atm so i dont know his name. Also how could i confine the color finder to only the minimap?

    Just ask if you guys want me to post what I have so far

  10. #10
    Join Date
    Dec 2011
    Location
    Toronto, Ontario
    Posts
    6,424
    Mentioned
    84 Post(s)
    Quoted
    863 Post(s)

    Default

    Use my function, FindNearestNPC, it's in the snippets section.

  11. #11
    Join Date
    Feb 2012
    Posts
    46
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Sin View Post
    Use my function, FindNearestNPC, it's in the snippets section.
    Wow, why has no one recommended this function to me.. Looks like exactly what I need. The only thing I'm unfamiliar with are the parameter of FindColorSpiralTolerance. You used it in your function and I'm assuming I might have to change the values (it's also helpful for the future).

  12. #12
    Join Date
    Dec 2011
    Location
    Toronto, Ontario
    Posts
    6,424
    Mentioned
    84 Post(s)
    Quoted
    863 Post(s)

    Default

    Nah don't change the parameters.

    Simba Code:
    function FindNearestNPC(var x,y:Integer;Click,DoWait:Boolean):Boolean;
    var
      x,y:Integer;
    begin
      if FindColorSpiralTolerance(x,y,65536,558,6,690,153,4) then
      begin
        Result := True;
        if (Click = True) and (Result = True) then
          Mouse(x,y,1,1,True);
        if DoWait = True then
        begin
          FFlag(1);
          Wait(750 + random(200));
        end;
      end;
    end;
    function FindNearestNPC(var x,y:Integer;Click,DoWait:Boolean):Boolean;

    x,y returns the values of the monster locations.
    Click is a boolean(True/False) to click there
    DoWait is another boolean which if clicked then will find the flag and wait until it walks there.

  13. #13
    Join Date
    Feb 2012
    Posts
    46
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I'm not sure I'm using it right. Would you be kind enough to break down the code, or explain to me how to implement this into my code. Sorry, really new to this.

    Also, what is the keyboard key to stop a script? I forget now, and everytime I test this and the mouse fucks up, it always causes a problem.

  14. #14
    Join Date
    Dec 2011
    Location
    Toronto, Ontario
    Posts
    6,424
    Mentioned
    84 Post(s)
    Quoted
    863 Post(s)

    Default

    Basically -
    Simba Code:
    Repeat
     Wait(100)
    Until(FindNearestNpc(x,y,False,False));

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
  •