Results 1 to 6 of 6

Thread: object does exists?

  1. #1
    Join Date
    Dec 2015
    Posts
    16
    Mentioned
    0 Post(s)
    Quoted
    8 Post(s)

    Default object does exists?

    Hello its me again,

    i am atm working on a script which i made color based with areolib.
    Now i try to remake it to use reflection. Just wonderin is there no pre written function which lets you check if an object u searched for is still there? like for example when chopping a tree or when mining a rock if it is empty? Couldn't find any function in the library :/

    thanks

  2. #2
    Join Date
    Apr 2013
    Posts
    680
    Mentioned
    13 Post(s)
    Quoted
    341 Post(s)

    Default

    Using reflection; the id's change - depending on the status of the object.

    give this a go. https://villavu.com/forum/showthread.php?t=112438

    <------------------>



  3. #3
    Join Date
    Dec 2015
    Posts
    16
    Mentioned
    0 Post(s)
    Quoted
    8 Post(s)

    Default

    uh thats freaking help full thanks :3

  4. #4
    Join Date
    Apr 2013
    Posts
    680
    Mentioned
    13 Post(s)
    Quoted
    341 Post(s)

    Default

    Code:
    Function OpenBank :boolean;
      var
        Bank: TReflectObject;                            // TReflectNPC / TReflectInvItem; / TReflectBankItem; etc...
    begin
      if Bank.Find(objGame, 'Bank booth', 10) then begin // 10 = area to search
        Reflect.Mouse.Move(Bank.GetMSPoint, 3, 3);
         wait(100+random(500));
        Reflect.Mouse.Click(Mouse_Right);
     end;
    A sample of finding a bank - i think the rest is pretty self explanatory

    <------------------>



  5. #5
    Join Date
    Dec 2015
    Posts
    16
    Mentioned
    0 Post(s)
    Quoted
    8 Post(s)

    Default

    Quote Originally Posted by AFools View Post
    Code:
    Function OpenBank :boolean;
      var
        Bank: TReflectObject;                            // TReflectNPC / TReflectInvItem; / TReflectBankItem; etc...
    begin
      if Bank.Find(objGame, 'Bank booth', 10) then begin // 10 = area to search
        Reflect.Mouse.Move(Bank.GetMSPoint, 3, 3);
         wait(100+random(500));
        Reflect.Mouse.Click(Mouse_Right);
     end;
    A sample of finding a bank - i think the rest is pretty self explanatory
    thanks but i know how to declare and use an object the struggle i had was with objects which change their ID's.
    AFool's link was quite helpfull and i found a solution for now, probably not the best one but hey im still learning :P

  6. #6
    Join Date
    Mar 2012
    Posts
    126
    Mentioned
    4 Post(s)
    Quoted
    20 Post(s)

    Default

    Quote Originally Posted by nenci494 View Post
    thanks but i know how to declare and use an object the struggle i had was with objects which change their ID's.
    AFool's link was quite helpfull and i found a solution for now, probably not the best one but hey im still learning :P
    I'm sure you could take a look at ineedbot's Woodcutter and find a similar function. His chopper detects if a tree is "empty" or "full".

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
  •