Simulating system's mouse cursor with a picturebox?

Discussion in 'RuneScape Programming' started by arrd, Nov 9, 2017.

Simulating system's mouse cursor with a picturebox?
  1. Unread #1 - Nov 9, 2017 at 2:46 PM
  2. arrd
    Joined:
    Oct 13, 2017
    Posts:
    67
    Referrals:
    0
    Sythe Gold:
    55

    arrd Member

    Simulating system's mouse cursor with a picturebox?

    Hi all :)

    I'm currently finishing off work on an RS3/OSRS bot that uses advanced color-detection algorithms, coupled with pre-recorded mouse-movement and other anti-ban methods (in no ways is this a conventional injection bot - I have no knowledge about Java). I've finished trialing two weeks of using a single 'script' that I wrote for RS3 fletching - botting 10 hours a day for 14 days straight (50 min play, 10 min break - exact integer determining break and playtime is determined by a deterministic algorithm).

    Despite this heavy botting (IN RS3, MIGHT I ADD!!), I didn't get banned. It's safe to say that my method works well. However, I intend this client, and its scripts, to be used for massive-scale gold farming operations for IRL profits. Now I need to ensure that I can operate multiple accounts (in minimized state) on multiple computers/VPS's at once. Since it's currently using the system cursor, rather than a cursor dedicated to my client only, this cannot happen.

    So my question is: How can I make a picturebox impersonate a cursor. Of course, it's simple to make it move about on a set of client coordinates, but it must actually act like a cursor (i.e. in the RuneScape client, it must get a reaction from having the mouse_over the buttons on RS's interface. All botting clients are able to do this effectively, however I don't know how to.

    If you can tell me how, not only would I be extremely grateful, but I'll also allow exclusive access to anyone who helps me out to use my software to run their own gold farming operations.

    If you want to so kindly include code blocks to help me out, I'm using C# - however for anyone who knows Visual Basic.NET, that's fine too as it can easily be converted.

    I look forward to hearing back from anybody interested in helping :),
    Arr
     
  3. Unread #2 - Nov 9, 2017 at 3:52 PM
  4. Eru
    Joined:
    Apr 9, 2012
    Posts:
    1,159
    Referrals:
    2
    Sythe Gold:
    288

    Eru Formerly known as Leaf of Life
    Graphics Artist $200 USD Donor New

    Simulating system's mouse cursor with a picturebox?

    I can not help you because I do not understand your question, what do you mean with this 'How can I make a picturebox impersonate a cursor'?
     
    ^ arrd likes this.
  5. Unread #3 - Nov 9, 2017 at 4:08 PM
  6. Fast Coins
    Joined:
    Mar 22, 2017
    Posts:
    1,355
    Referrals:
    1
    Sythe Gold:
    1,458
    Discord Unique ID:
    369860055660494849
    Discord Username:
    kombat#5624

    Fast Coins Guru
    $5 USD Donor New

    Simulating system's mouse cursor with a picturebox?

    Hi!

    Couple of questions:
    Fancy words that don't say much. What is the input for the algo?

    Not familiar with RS3. Does it have higher ban-rates compared to OSRS?

    I don't know much C# but isn't PictureBox an image control/ element on a GUI? If, then I don't understand how it is related to impersonating it as a cursor.
    Did you make a cursor image (on a GUI) that you are trying to "impersonate" as a real cursor? W-why the image?

    Botting clients usually inject code to achieve that. Easy to do in Java as the Rs client is programmed in Java. With C# you have to take another route. Or make an external Java program to do that, and call that from C# to make the mouse actions.

    EDIT: Check out user32.dll and SendInput Windows API
     
    Last edited: Nov 9, 2017
  7. Unread #4 - Nov 9, 2017 at 4:19 PM
  8. arrd
    Joined:
    Oct 13, 2017
    Posts:
    67
    Referrals:
    0
    Sythe Gold:
    55

    arrd Member

    Simulating system's mouse cursor with a picturebox?

    The reason why I am trying to "impersonate" a real cursor is because I need to farm on multiple accounts on a single computer. Using the system mouse itself (as there is only one of them) will not allow me to play multiple accounts per computer/VPS. I need to integrate a mock-cursor that the RS3 client can detect as a cursor, but it's confined to a single botting client only. Hopefully you understand what I'm trying to achieve now. RS3 has a much higher ban-rate than OSRS. However, my method of botting works, I can say that with utter confidence - however I'm just stuck on this last problem.

    Thanks for the reply, and thanks for any future help in advance,
    Arr
     
    Last edited: Nov 9, 2017
  9. Unread #5 - Nov 9, 2017 at 4:22 PM
  10. Fast Coins
    Joined:
    Mar 22, 2017
    Posts:
    1,355
    Referrals:
    1
    Sythe Gold:
    1,458
    Discord Unique ID:
    369860055660494849
    Discord Username:
    kombat#5624

    Fast Coins Guru
    $5 USD Donor New

    Simulating system's mouse cursor with a picturebox?

    You didn't really answer my question(s). What is the PictureBox for? Does it DISPLAY a cursor icon? or... what?
     
  11. Unread #6 - Nov 9, 2017 at 4:27 PM
  12. arrd
    Joined:
    Oct 13, 2017
    Posts:
    67
    Referrals:
    0
    Sythe Gold:
    55

    arrd Member

    Simulating system's mouse cursor with a picturebox?

    Apologies, yeah, it displays a cursor icon. I've managed to programmatically assign a 'hotspot' on the cursor in the picturebox (this is the pixel that the cursor image actually represents), but that's how far I've gotten. I need someone with a little more skill than I to help me.

    Thanks :)
     
  13. Unread #7 - Nov 9, 2017 at 4:29 PM
  14. Eru
    Joined:
    Apr 9, 2012
    Posts:
    1,159
    Referrals:
    2
    Sythe Gold:
    288

    Eru Formerly known as Leaf of Life
    Graphics Artist $200 USD Donor New

    Simulating system's mouse cursor with a picturebox?

    I think he wants a virtual mouse per client so he can bot multiple accounts on one machine.
     
    ^ arrd likes this.
  15. Unread #8 - Nov 9, 2017 at 4:33 PM
  16. Fast Coins
    Joined:
    Mar 22, 2017
    Posts:
    1,355
    Referrals:
    1
    Sythe Gold:
    1,458
    Discord Unique ID:
    369860055660494849
    Discord Username:
    kombat#5624

    Fast Coins Guru
    $5 USD Donor New

    Simulating system's mouse cursor with a picturebox?

    hmm, I don't think you can do that - to "display" a cursor image to the client while it is minimized. So I would drop the PictureBox idea. However you can send mouse events to multiple rs clients without interrupting the "real" cursor. But as I said earlier, this requires Java code injection or something low-level.
    Check these things out, maybe:
     
  17. Unread #9 - Nov 9, 2017 at 4:34 PM
  18. arrd
    Joined:
    Oct 13, 2017
    Posts:
    67
    Referrals:
    0
    Sythe Gold:
    55

    arrd Member

    Simulating system's mouse cursor with a picturebox?

    Thanks Leaf :) That's exactly what I need. One with the same kind of properties as a normal cursor, that way RuneScape can detect that a normal cursor is being used.
     
    ^ Eru likes this.
  19. Unread #10 - Nov 9, 2017 at 4:35 PM
  20. arrd
    Joined:
    Oct 13, 2017
    Posts:
    67
    Referrals:
    0
    Sythe Gold:
    55

    arrd Member

    Simulating system's mouse cursor with a picturebox?

    Thanks for the suggestion FastCoins! I cannot use Java or anything that requires modification of the client's code. I don't want to risk that (and I don't know Java). But I'll go check out SendInput and how that might help.

    I'll keep you updated, any more suggestions, I'll check, Thanks.
     
  21. Unread #11 - Nov 9, 2017 at 4:36 PM
  22. Fast Coins
    Joined:
    Mar 22, 2017
    Posts:
    1,355
    Referrals:
    1
    Sythe Gold:
    1,458
    Discord Unique ID:
    369860055660494849
    Discord Username:
    kombat#5624

    Fast Coins Guru
    $5 USD Donor New

    Simulating system's mouse cursor with a picturebox?

    I don't think it works like that. The detection would then be image-based, at best. Do you think Jagex really finds the image of your cursor from the screen?
     
    Last edited: Nov 9, 2017
  23. Unread #12 - Nov 9, 2017 at 4:41 PM
  24. arrd
    Joined:
    Oct 13, 2017
    Posts:
    67
    Referrals:
    0
    Sythe Gold:
    55

    arrd Member

    Simulating system's mouse cursor with a picturebox?

    No, that's not what I'm saying. I've managed to make it so that a picturebox can move about my form following a set of listed coordinates, but obviously this won't have the same properties as a normal mouse - what I mean by this is that, say if the picturebox is hovering over a RuneScape button that is supposed to change animation on mouse_over, if it does not, then it's obviously a cheap mouse-recorder. This, undoubtedly, they monitor for. Obviously not the graphics of your cursor, there would be no way to monitor for that server-side.
     
  25. Unread #13 - Nov 9, 2017 at 5:19 PM
  26. Fast Coins
    Joined:
    Mar 22, 2017
    Posts:
    1,355
    Referrals:
    1
    Sythe Gold:
    1,458
    Discord Unique ID:
    369860055660494849
    Discord Username:
    kombat#5624

    Fast Coins Guru
    $5 USD Donor New

    Simulating system's mouse cursor with a picturebox?

    Ah, I mis-understood. I thought it was necessary to maintain control over the system, having clients minimized, and your program doing the work.
    The picturebox needs to move over the client to perform actions, yes?
    This brings up other questions. Say you want to bot 10 clients simultaneously. They don't have the room to be all opened at once. You would then need to switch between clients. Right?
    Also, you have to somehow send the right event (e.x. mouse move) to the coordinate/ control for the client to be able to act upon. You can't make the GUI (picturebox) on top of it, do it. You could however do the following:
    Inject appropriate code, and then injectedMouse.moveTo(inventoryTab.x/y) and window.move(PictureBox).to(inventoryTab.x/y). So the picturebox is on the same position (inventory tab, in this example) with the "virtual" mouse. Same thing with clicking.
    But what does it really give us? A GUI following a virtual mouse. Cool. Problem is, Jagex doesn't give a damn about a random window hovering over their client (as you can't give it properties of a mouse, except the looks).

    So your best bet is to check out the options I pointed out previously.

    EDIT:
    Mouse recorder records your mouse movements. It is moving the "real" cursor. So when it hovers over an item in RS client that needs to emit a message to the top left corner, it will do so. With mouse recorders, it is the same as moving it yourself.
     
    Last edited: Nov 9, 2017
  27. Unread #14 - Nov 9, 2017 at 5:23 PM
  28. arrd
    Joined:
    Oct 13, 2017
    Posts:
    67
    Referrals:
    0
    Sythe Gold:
    55

    arrd Member

    Simulating system's mouse cursor with a picturebox?

    Right, what I meant was one of the really old ones whereby only the click coordinates were recorded and played back (no mousehover), so essentially Jagex saw a mouse jumping from one side of the game, to the other.
    I'm still working on it, I haven't abandoned your post :) Might take all night though...
     
    Last edited: Nov 9, 2017
  29. Unread #15 - Nov 9, 2017 at 5:30 PM
  30. arrd
    Joined:
    Oct 13, 2017
    Posts:
    67
    Referrals:
    0
    Sythe Gold:
    55

    arrd Member

    Simulating system's mouse cursor with a picturebox?

    <strike>If</strike> When I finish the project, and this is the only problem remaining, then I just have a few optimizations to make, will you be interested in a copy for your own personal use, or not?
     
  31. Unread #16 - Nov 9, 2017 at 5:34 PM
  32. Fast Coins
    Joined:
    Mar 22, 2017
    Posts:
    1,355
    Referrals:
    1
    Sythe Gold:
    1,458
    Discord Unique ID:
    369860055660494849
    Discord Username:
    kombat#5624

    Fast Coins Guru
    $5 USD Donor New

    Simulating system's mouse cursor with a picturebox?

    Flattered by the offer, but I'm already very busy with other stuff. Botfarm sounds easy, but it does require time :p
     
    ^ arrd likes this.
  33. Unread #17 - Nov 14, 2017 at 12:05 AM
  34. Blupig
    Joined:
    Nov 23, 2006
    Posts:
    7,145
    Referrals:
    16
    Sythe Gold:
    1,609
    Discord Unique ID:
    178533992981594112
    Valentine's Singing Competition Winner Member of the Month Winner MushyMuncher Gohan has AIDS Extreme Homosex World War 3 I'm LAAAAAAAME
    Off Topic Participant

    Blupig BEEF TOILET
    $5 USD Donor

    Simulating system's mouse cursor with a picturebox?

    Your thought process is all wrong. You're not duplicating or replicating the mouse really at all with other bots - they're sending messages and hooking directly into the RS applet. The cursor you see is just a bi-product of the messages being sent and displayed by the client. This is a form of reflection. As such, it has to be done with Java.

    ScionBot was an RS bot made in C# a long time ago and they had to make the mouse handler in Java then tie it into C# via JVM interop. The source might be floating around the internet somewhere. Maybe look at that.

    C# and Java are very similar. Honestly just learn Java.
     
    ^ Dev Zach, arrd, Cam and 2 others like this.
  35. Unread #18 - Nov 15, 2017 at 5:58 PM
  36. arrd
    Joined:
    Oct 13, 2017
    Posts:
    67
    Referrals:
    0
    Sythe Gold:
    55

    arrd Member

    Simulating system's mouse cursor with a picturebox?

    Thanks so much for your reply blupig. I take it you were reasonably involved in Jaco's project? I'm really interested in this project and have managed to dig the source code for v. 1.0.0.0. Unfortunately, as you may know, the project saw the release of multiple more versions (up to 2.0?). Do you have access to the latest project files?

    Also, do you know why my Scion.exe freezes when attempting to initialize the bot?

    Thanks very much for your help!
     
  37. Unread #19 - Nov 15, 2017 at 6:00 PM
  38. arrd
    Joined:
    Oct 13, 2017
    Posts:
    67
    Referrals:
    0
    Sythe Gold:
    55

    arrd Member

    Simulating system's mouse cursor with a picturebox?

  39. Unread #20 - Nov 15, 2017 at 9:45 PM
  40. Blupig
    Joined:
    Nov 23, 2006
    Posts:
    7,145
    Referrals:
    16
    Sythe Gold:
    1,609
    Discord Unique ID:
    178533992981594112
    Valentine's Singing Competition Winner Member of the Month Winner MushyMuncher Gohan has AIDS Extreme Homosex World War 3 I'm LAAAAAAAME
    Off Topic Participant

    Blupig BEEF TOILET
    $5 USD Donor

    Simulating system's mouse cursor with a picturebox?

    I don't have any copies of the source anymore, and as for my involvement, I only made scripts for it. It freezes because everything has changed in the game since then. It's trying to load RS from '09 which obviously doesn't exist anymore.

    You're not going to be able to get the bot running. Your best shot for your own bot is to deconstruct ScionBot and find the code for the mouse handler. It'll be in Java.
     
    ^ arrd likes this.
< How long does it take to be decent at writing botting scripts? | >

Users viewing this thread
1 guest


 
 
Adblock breaks this site