+ Reply to Thread
Results 1 to 15 of 15

Thread: Right clicking rocks

  1. #1
    Join Date
    Apr 2008
    Location
    Marquette, MI
    Posts
    15,252
    Mentioned
    138 Post(s)
    Quoted
    680 Post(s)

    Default Right clicking rocks

    Hey guys,

    I don't have time to look at this now, but I was just watching it a little, and it right clicks the rocks A LOT. The thing is, it right clicks, but it doesn't choose the option? I think it should left click a lot more than it's right clicking, and it seems we need to change the option a little. I'm not exactly sure why it's not working.

    I'm going to leave it running over night with 8 players, we'll see how it goes.

  2. #2
    Join Date
    Oct 2007
    Location
    #srl
    Posts
    6,102
    Mentioned
    39 Post(s)
    Quoted
    62 Post(s)

    Default

    I'm quite sure the problem with it not choosing the option is with ChooseOption(); It happens to me a lot and I have to use something like:
    SCAR Code:
    WaitOptionMulti(['in', 'ne', 'Mine', 'ne R', 'ock'], ...);

    That usually fixes it..

    Possible solution to this, make .option an array, then we can do what is shown above, and hopefully that will solve that problem.

    The reason it RightClick's is because I have:
    SCAR Code:
    if WaitUpText(Rocks[i].UpText, 1200) then
            begin
              GetMousePos(x, y);
              if Rocks[i].RightClickOnly then
                Mouse(x, y, 0, 0, Rocks[i].RightClickOnly)
              else
              begin
                Click := (Random(4) < 2);
                Mouse(x, y, 0, 0, Click);
              end;

              if (not(Click)) and Rocks[i].RightClickOnly then
                Result := WaitOption(Rocks[i].Option, 2000)
              else
                Result := True;

              if Result then
                MSI_WaitWhileMining(Rocks, i, Point(tP.x, tP.y));
              Exit;
            end;
          end;
    in 'MSI_MineRock;' by your request


    As you can see above, the reason it RightClick's is because every time it finds the rock, it chooses randomly using this:
    SCAR Code:
    begin
                Click := (Random(4) < 2);
                Mouse(x, y, 0, 0, Click);
              end;
    to click left or right. Right now it has a 50% chance of each.

    The main reason it Clicks so much right now is because WaitWhileChopping; is messing up, I'm assuming anyways.

    However, if you still would rather it RightClick less we could make it:
    SCAR Code:
    begin
                Click := (Random(3) < 2);
                Mouse(x, y, 0, 0, Click);
              end;
    and that would only make it RightClick a third of the time.

    I probably wont have much time tomorrow, but Friday I can probably work on WaitWhileMining; and hopefully get that working 100%.
    Last edited by NCDS; 07-15-2010 at 04:46 AM.

  3. #3
    Join Date
    Apr 2008
    Location
    Marquette, MI
    Posts
    15,252
    Mentioned
    138 Post(s)
    Quoted
    680 Post(s)

    Default

    Yes, the right clicking should be more like
    SCAR Code:
    Click := (Random 10 < 7);
    I work all day today, but I should be able to look tonight if no on else does.

    E: I also thought about for something to add to WaitWhileMining, thoughts? It would obviously be a little better, but this is the basic idea.
    SCAR Code:
    procedure WaitWhileMining;
    begin
      for i := 1 to 28 do
        while (not ExistsItem(i)) do
          Wait(RandomRange(500, 1000));
    end;

    E2: I would also probably be useful if we added some debugging to the mining functions seeing as we don't use the Objects.scar functions.
    Last edited by Coh3n; 07-15-2010 at 10:11 AM.

  4. #4
    Join Date
    Oct 2007
    Location
    #srl
    Posts
    6,102
    Mentioned
    39 Post(s)
    Quoted
    62 Post(s)

    Default

    Quote Originally Posted by Coh3n View Post
    Yes, the right clicking should be more like
    SCAR Code:
    Click := (Random 10 < 7);
    I work all day today, but I should be able to look tonight if no on else does.

    E: I also thought about for something to add to WaitWhileMining, thoughts? It would obviously be a little better, but this is the basic idea.
    SCAR Code:
    procedure WaitWhileMining;
    begin
      for i := 1 to 28 do
        while (not ExistsItem(i)) do
          Wait(RandomRange(500, 1000));
    end;
    What if someone else gets the ore though?

    Quote Originally Posted by Coh3n View Post
    E2: I would also probably be useful if we added some debugging to the mining functions seeing as we don't use the Objects.scar functions.
    I was thinking the same.


    Edit:
    I committed:
    SCAR Code:
    Click := (Random(10) < 7);

    I can maybe get to something later tonight, but the rest will be tomorrow hopefully
    Last edited by NCDS; 07-15-2010 at 06:19 PM.

  5. #5
    Join Date
    Apr 2008
    Location
    Marquette, MI
    Posts
    15,252
    Mentioned
    138 Post(s)
    Quoted
    680 Post(s)

    Default

    That would just be one thing to add, it wouldn't be the only thing we look for.

  6. #6
    Join Date
    Oct 2007
    Location
    #srl
    Posts
    6,102
    Mentioned
    39 Post(s)
    Quoted
    62 Post(s)

    Default

    Quote Originally Posted by Coh3n View Post
    That would just be one thing to add, it wouldn't be the only thing we look for.
    Do you agree with making the .Option a TStringArray then?

  7. #7
    Join Date
    Apr 2008
    Location
    Marquette, MI
    Posts
    15,252
    Mentioned
    138 Post(s)
    Quoted
    680 Post(s)

    Default

    Quote Originally Posted by NCDS View Post
    Do you agree with making the .Option a TStringArray then?
    It may not be a bad idea, but we shouldn't need it. I would rather try like 'ne Rock', 'e Ro', 'e Roc' before switching. The thing about using just parts from the word 'Rock' is that is could choose 'Examine Rock' rather than 'Mine Rock'. I know ChooseOption is suppose to click the first occurrence, but I've had it pick the second, or sometimes third.

  8. #8
    Join Date
    Oct 2007
    Location
    #srl
    Posts
    6,102
    Mentioned
    39 Post(s)
    Quoted
    62 Post(s)

    Default

    Yeah, I'll mess with it while testing. Let me know if you fix it before I do.

  9. #9
    Join Date
    Jul 2007
    Location
    Right now? Chair.
    Posts
    8,488
    Mentioned
    3 Post(s)
    Quoted
    12 Post(s)

    Default

    SCAR Code:
    Click := (Random(10) < 7);

    CONSTANTS ! ! ! ! !

    ['ine Rock', 'ine', 'Mine']

    ~RM

    I & I know Zion. It is in the spirit, body and mind of every one of us
    RMouse(obj: TMSIObject): boolean;

  10. #10
    Join Date
    Oct 2007
    Location
    #srl
    Posts
    6,102
    Mentioned
    39 Post(s)
    Quoted
    62 Post(s)

    Default

    Quote Originally Posted by Rasta Magician View Post
    SCAR Code:
    Click := (Random(10) < 7);

    CONSTANTS ! ! ! ! !

    ['ine Rock', 'ine', 'Mine']

    ~RM
    I'll get it when I switch it to use MSI_FindObj();

  11. #11
    Join Date
    May 2008
    Location
    ;)
    Posts
    576
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    On the topic of right clicking rocks, I have also noticed, that it right clicks one, doesn't choose the option, and instead, just kind of 'hangs' there for awhile (I assume a timeout of some sort?),
    and then it doesn't always find a rock, because the right-click menu hides uptext and covers up rocks (was at VEM).
    Could just be my fonts not working right. Idk, i'll restart simba and try some other things to see if i can get it to work.

  12. #12
    Join Date
    Apr 2008
    Location
    Marquette, MI
    Posts
    15,252
    Mentioned
    138 Post(s)
    Quoted
    680 Post(s)

    Default

    Quote Originally Posted by nickrules View Post
    On the topic of right clicking rocks, I have also noticed, that it right clicks one, doesn't choose the option, and instead, just kind of 'hangs' there for awhile (I assume a timeout of some sort?),
    and then it doesn't always find a rock, because the right-click menu hides uptext and covers up rocks (was at VEM).
    Could just be my fonts not working right. Idk, i'll restart simba and try some other things to see if i can get it to work.
    It's not just your fonts, it's everyone's. Either that or ChooseOption is broken. Anyway, it does the same for me. I'm gonna see if I can fix this right now.

  13. #13
    Join Date
    May 2008
    Location
    ;)
    Posts
    576
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    I just modified the mining.scar file. Temporary fix.

    Edit: Just realized this was my 100th post
    Last edited by nickrules; 07-20-2010 at 02:28 PM.

  14. #14
    Join Date
    Apr 2008
    Location
    Marquette, MI
    Posts
    15,252
    Mentioned
    138 Post(s)
    Quoted
    680 Post(s)

    Default

    Quote Originally Posted by nickrules View Post
    I just modified the mining.scar file. Temporary fix.
    Fixed in revision 159. Yeah, the bug was in MSI_MineRocks.

    Thanks nick.

  15. #15
    Join Date
    Oct 2007
    Location
    #srl
    Posts
    6,102
    Mentioned
    39 Post(s)
    Quoted
    62 Post(s)

    Default

    Quote Originally Posted by Coh3n View Post
    Fixed in revision 159. Yeah, the bug was in MSI_MineRocks.

    Thanks nick.
    It wasn't just ChooseOption messing up?

    MSN me, I'm curious

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may post attachments
  • You may edit your posts
  •