Jump to content

Pythons

Members
  • Posts

    1
  • Joined

  • Last visited

  • Feedback

    0%

Profile Information

  • Gender
    Male

Recent Profile Visitors

544 profile views

Pythons's Achievements

Newbie

Newbie (1/10)

0

Reputation

  1. Hi, this is an idea of how to accomplish your problem using python. If you need it in java, the syntax should translate fairly easily. I'm going to assume each square is 30x30 pixels and the upper left corner is 0x0. import win32api import random whichitem = list() ########## for x in range(0,23): #Generate items whichitem.append(x) # ########## for x in range(0, 23): i = random.randint(0, (len(whichitem) - 1)) #Choose which item item = whichitem # del whichitem # ########## if item <= 7: #Get coordinates of the item y = 15 # x = 15 + 30*(item) # else if 7 < item <= 15: # y = 45 # x = 15 + 30*(item - 8) # else: # y = 75 # x = 15 + 30*(item - 16) # ########## def click(x,y): #click the middle of the item win32api.SetCursorPos((x,y)) win32api.mouse_event(win32con.MOUSEEVENTF_LEFTDOWN,x,y,0,0) win32api.mouse_event(win32con.MOUSEEVENTF_LEFTUP,x,y,0,0) click(x, y) ########## So this will click one of 24 items randomly. After an item has been clicked, it will no longer click that spot. It will click the middle of each spot. The hashtags are comments, I tried to make it easier to read. This is just a very general idea of how you can easily use an array or list to do the problem. Of course, there is a great deal more to consider before implementing this in a bot. Some stuff you should also consider would be: random delay between clicks random delay on press duration (this would be in between the LEFTDOWN and LEFTUP lines of code. This is where a lot of bots fail instantly) random x/y location on each item (rather than the middle) random x/y drift amount between button press and release (most often zero but will be 1 or 2 regularly) generating a path rather than teleport the cursor A straight line beats teleporting the cursor, but a curve beats a straight line. Lots of ways you could go about this, off the top of my head a Fourier series would probably beat using splines. You could also divide the distance into n segments and generate a new curve between each segment, if you really want to cover your ass. Just thinking out loud now.... SetCursorPos doesn't actually input a mouse event into the command line, so jagex wouldn't see a mouse movement input command (though the mouse would light up their hook, e.g: http://output.jsbin.com/gejuz/1) You'd have to use win32con.MOUSEEVENTF_MOVE to actually send a mouse movement input. For my codes I manually do the skilling or whatever for a couple hours and record the data. Then you can get your variance, min/max, the type of distribution, etc. It's necessary to factor that into all the above variables to really give the randomness some humanlike qualities. Consider if you were to randomly click a square 30x30 pixel box 10000 times. The locations are random, sure. But then you zoom out and you see a solid black box on a white backdrop. Boundaries is how PRNG gets cracked and I have it on good authority that Jagex uses some sort of Diehard test suite in JS that will analyze data to sniff out poorly hidden RNG. Anyway man i'm getting rambly so just message me if you want to chat about it! GL
×
×
  • Create New...