SRL Archive - Java Help and Tutorials

Progress on a bot iv been working on :)


iCURiP

2011-12-23 23:07:23

http://www.youtube.com/watch?v=qH2s1kMwYUo&feature=youtu.be
Feedback <3

Sorry about the Trial thing that keeps popping up, it would of took 90 minutes to upload instead of 10 if i didn't convert it.

Also, this is a very simple script which took me less than 5 minutes to write, i didn't have enough time to make a big one. (As you can see 3:16 am)

Richard

2011-12-23 23:11:36

Would we be lucky enough to see source? :)
While making that Pixel class I had a feeling you might be making a program with the intents of botting. Looks nice.

YoHoJo

2011-12-23 23:12:08

Any explinations about it?
Did you code the bot itself yourself, or just the script?
Is it color, or reflection, or OGL?
Plans to release it? Have a website? Sell scripts? etc?
Nice work. Neat to see.
I heard making Java bots now (deobbing client etc) can get you in big legal trouble?
Working with any others?

RISK

2011-12-23 23:14:13

Looks great! :) Yeah, can we see the source, please?

It's color based, YoHoJo and it doesn't deobfuscate the client. It uses the regular Runescape client. At least from what I can tell from seeing the code.

iCURiP

2011-12-23 23:21:45

Its purely color made by me from scratch, and its still work in progress, therefore its not ready yet to give to people, I wouldn't want to release anything that's anything less than perfect. :), although… if anyone else is currently making a bot also, if I have methods you need I will gladly help you out.

Thanks for the great feedback, wasn't expecting so much positivity.

YoHoJo:

Color based, looking into OGL also.
Yes did it myself :)
Don't have a website, or any sort of money related things, this is for learning experience, I'm 15 and am starting with projects like these in order to improve my knowledge, a job doing something to do this would be my dream *when I'm a growned up xD*.
Working alone.
Yeah i herd that too, but according to people like pb its nothing to worry about.

YoHoJo

2011-12-23 23:27:25

hurr durr fuk u bro u bot sux u will never b like jabmob rsbuddy is da best and nexis is also better den u broh you don no what u doing u noob stop making da bad bots!

Like that?
Naah man, good work, cool to see!

Richard

2011-12-23 23:27:30

From: iCURiP
Its purely color made by me from scratch, and its still work in progress, therefore its not ready yet to give to people, I wouldn't want to release anything that's anything less than perfect. :), although… if anyone else is currently making a bot also, if I have methods you need I will gladly help you out.

Thanks for the great feedback, wasn't expecting so much positivity.


I'm tempted, but I don't think I have the time to. Healthy competition would be nice though :) What methods did you use for getting pixels of certain colour in the end?

iCURiP

2011-12-23 23:36:56

From: Richard
I'm tempted, but I don't think I have the time to. Healthy competition would be nice though :) What methods did you use for getting pixels of certain colour in the end?


	
public static Point getColor(Color c, Rectangle rect) throws AWTException{

final Robot r = new Robot();
final int startwidth = rect.x;
final int startheight = rect.y;
final int width = rect.x + rect.width;
final int height = rect.y + rect.height;
final int color = c.getRGB();

final BufferedImage image = r.createScreenCapture(new Rectangle (0, 0, 1365, 767));

for(int countHeight = startheight; countHeight < height; countHeight ++){
for(int countWidth = startwidth; countWidth < width; countWidth ++){
if(image.getRGB(countWidth, countHeight) == color){
return new Point(countWidth, countHeight);
}
}
}
return null;
}

I can't remember your code exactly, i don't know if you used rectangles also, but its best to search only in the areas that you need to, which not only makes it faster but avoids it finding things you don't want it to, also using a lot of "finals" speeds it up by a great amount as its not trying to find the same data over and over.

Richard

2011-12-23 23:43:12

From: iCURiP
	
public static Point getColor(Color c, Rectangle rect) throws AWTException{

final Robot r = new Robot();
final int startwidth = rect.x;
final int startheight = rect.y;
final int width = rect.x + rect.width;
final int height = rect.y + rect.height;
final int color = c.getRGB();

final BufferedImage image = r.createScreenCapture(new Rectangle (0, 0, 1365, 767));

for(int countHeight = startheight; countHeight < height; countHeight ++){
for(int countWidth = startwidth; countWidth < width; countWidth ++){
if(image.getRGB(countWidth, countHeight) == color){
return new Point(countWidth, countHeight);
}
}
}
return null;
}

I can't remember your code exactly, i don't know if you used rectangles also, but its best to search only in the areas that you need to, which not only makes it faster but avoids it finding things you don't want it to, also using a lot of "finals" speeds it up by a great amount as its not trying to find the same data over and over.



I didn't realise that using final would speed things up, I'll look into the speed difference when it's not almost 5 in the morning :P
My system was essentially the same, except it just used the whole desktop, so it would work on any resolution, and it returned more than one point in the searching, hence the crazy data :P

iCURiP

2011-12-23 23:50:53

From: Richard
I didn't realise that using final would speed things up, I'll look into the speed difference when it's not almost 5 in the morning :P
My system was essentially the same, except it just used the whole desktop, so it would work on any resolution, and it returned more than one point in the searching, hence the crazy data :P


Ah i see, would you happen to know a method to find the RS window rectangle?

Method

2011-12-24 00:35:33

From: iCURiP
	
public static Point getColor(Color c, Rectangle rect) throws AWTException{

final Robot r = new Robot();
final int startwidth = rect.x;
final int startheight = rect.y;
final int width = rect.x + rect.width;
final int height = rect.y + rect.height;
final int color = c.getRGB();

final BufferedImage image = r.createScreenCapture(new Rectangle (0, 0, 1365, 767));

for(int countHeight = startheight; countHeight < height; countHeight ++){
for(int countWidth = startwidth; countWidth < width; countWidth ++){
if(image.getRGB(countWidth, countHeight) == color){
return new Point(countWidth, countHeight);
}
}
}
return null;
}

I can't remember your code exactly, i don't know if you used rectangles also, but its best to search only in the areas that you need to, which not only makes it faster but avoids it finding things you don't want it to, also using a lot of "finals" speeds it up by a great amount as its not trying to find the same data over and over.


Have you benchmarked the code with and without the 'final' keyword? I can't imagine its use producing any meaningful performance gains. The JVM should be able to ensure the finality of those local variables anyway, and it probably can optimize better than any of us can.

Failure

2011-12-24 01:13:23

From: iCURiP
http://www.youtube.com/watch?v=qH2s1kMwYUo&feature=youtu.be
Feedback <3

Sorry about the Trial thing that keeps popping up, it would of took 90 minutes to upload instead of 10 if i didn't convert it.

Also, this is a very simple script which took me less than 5 minutes to write, i didn't have enough time to make a big one. (As you can see 3:16 am)


Very nice, it truly is! :D

Ohh, if you're planning to make more video's (hopefully) and you need to convert, I highly recomming Format Factory been using it, works perfectly without the annoying ad in the YT video :p

Richard

2011-12-24 20:12:47

From: Method
Have you benchmarked the code with and without the 'final' keyword? I can't imagine its use producing any meaningful performance gains. The JVM should be able to ensure the finality of those local variables anyway, and it probably can optimize better than any of us can.


In 5 tests using the final keyword, and then 5 again without, I've noticed no notable difference. From what I can see, about half of the processing time is from capturing the image, and then another half from comparing ALL the pixels on the screen (when you think that the screen for RS botting would be a 16th of the size I've been using, that's a very small period of time).

Still, are there any more effective/efficient ways of comparing colours in a given area on the screen, compared to taking a screenshot using the Robot class?

iCURiP

2011-12-25 11:05:16

From: Richard
In 5 tests using the final keyword, and then 5 again without, I've noticed no notable difference. From what I can see, about half of the processing time is from capturing the image, and then another half from comparing ALL the pixels on the screen (when you think that the screen for RS botting would be a 16th of the size I've been using, that's a very small period of time).

Still, are there any more effective/efficient ways of comparing colours in a given area on the screen, compared to taking a screenshot using the Robot class?


I'm going to work on a image recognition class soon, including finding a image even if its been rotated, then that will probably be used in my walking method (Comparing a stored copy of the map with the mini-map to find your location.

*Any help is welcome xD*

pyroryan

2011-12-28 04:09:32

The final keyword doesn't really affect performance, its more for readability. There are only slight benefits to most keywords. Realistically the static keyword has a profound effect in terms of performance.

[XoL]

2011-12-28 12:08:14

Looks very interesting! Wish you the best on your progress :)

n3ss3s

2011-12-29 20:48:48

Trying to make a standalone "bot" in C++ at the moment (not sure if it's gonna be an autofighter or what), I think if you used winapi for grabbing the pixels you'd gain some speed.

EDIT: C# tbh, performance difference between C# and C++ is negligible, in C++ trivial shit like getting the length of an array is a problem of cosmic proportions, nty

Richard

2011-12-30 12:20:26

From: n3ss3s
Trying to make a standalone "bot" in C++ at the moment (not sure if it's gonna be an autofighter or what), I think if you used winapi for grabbing the pixels you'd gain some speed.

EDIT: C# tbh, performance difference between C# and C++ is negligible, in C++ trivial shit like getting the length of an array is a problem of cosmic proportions, nty


Wouldn't that mean it isn't cross platform though? I'd like to keep it cross platform given that a large amount of our user base use Linux

n3ss3s

2011-12-30 14:36:05

Well the garbage I'm making won't have it's own loader, it's gonna work like those oldass standalone autofighters etc.

ProRa

2012-01-23 05:32:21

I give u permission to use my hooks as soon as you send me the source ;)


~ ProRa's Runescape Public Hook Updater ~

1084 classes.

~ Version #699 - ]


SPP Hooks:
Toolkit => mra.e
MapAngle => hga.l
LoopCycle => tn.j

Animable:
jl implements org/GL/client/Animable
getX1() => static short jl.i
getY1() => static short jl.p
getX2() => static short jl.d
getY2() => static short jl.f

Cache:
dea implements org/GL/client/Cache
getTable() => org.GL.client.HashTable dea.b
getList() => org.GL.client.NodeSubQueue dea.a
getInitialCount() => int dea.c
getSpaceLeft() => int dea.d

Canvas:
Class => bu java.awt.Canvas = org/GL/client/input/Canvas
Utf8 => bu java/awt/Canvas = org/GL/client/input/Canvas

Client:
client implements org/GL/client/Client
getMouse() => static org.GL.client.input.Mouse sha.j
getCanvas() => static java.awt.Canvas lsa.a
getLoginIndex() => static int qfa.c * -767437059
getGUIRSInterfaceIndex() => static int vga.o * 1238906071
getViewport() => static org.GL.client.Viewport hu.d

DirectXModel:
pja implements org/GL/client/ModelDirectX
getXPoints() => int[] pja.R
getYPoints() => int[] pja.lb
getZPoints() => int[] pja.c
getIndices1() => short[] pja.F
getIndices2() => short[] pja.v
getIndices3() => short[] pja.m

DirectXRender:
np implements org/GL/client/DirectXRender

HardReference:
hja implements org/GL/client/HardReference
get() => java.lang.Object hja.h

HashTable:
dsa implements org/GL/client/HashTable
getBuckets() => org.GL.client.Node[] dsa.d

Keyboard:
Class => ul java.lang.Object = org/GL/client/input/Mouse
Utf8 => eka keyReleased = _keyReleased
Utf8 => eka focusLost = _focusLost
Utf8 => eka keyTyped = _keyTyped
Utf8 => eka focusGained = _focusGained
Utf8 => eka keyPressed = _keyPressed

LDModel:
oda implements org/GL/client/ModelLD
getIndices1() => short[] oda.p
getIndices2() => short[] oda.W
getIndices3() => short[] oda.h
getXPoints() => int[] oda.g
getYPoints() => int[] oda.gb
getZPoints() => int[] oda.eb

LDRender:
qca implements org/GL/client/LDRender

Model:
za implements org/GL/client/Model

Mouse:
Class => fl java.lang.Object = org/GL/client/input/Mouse
Utf8 => m mouseDragged = _mouseDragged
Utf8 => m mouseMoved = _mouseMoved
Utf8 => m mouseClicked = _mouseClicked
Utf8 => m mouseWheelMoved = _mouseWheelMoved
Utf8 => m mouseEntered = _mouseEntered
Utf8 => m mousePressed = _mousePressed
Utf8 => m mouseReleased = _mouseReleased
Utf8 => m mouseExited = _mouseExited
getMouseDataList() => org.GL.client.NodeDeque m.n
getLastMouseDataList() => org.GL.client.NodeDeque m.H
getX() => int m.L
getY() => int m.t
getComponent() => java.awt.Component m.x
isLoggingMouseMovements() => boolean m.K

Node:
ca implements org/GL/client/Node
getId() => long ca.b
getNext() => org.GL.client.Node ca.a
getPrevious() => org.GL.client.Node ca.c

NodeDeque:
ita implements org/GL/client/NodeDeque
getCurrent() => org.GL.client.Node ita.a
getTail() => org.GL.client.Node ita.b

NodeSub:
vf implements org/GL/client/NodeSub
getNextSub() => org.GL.client.NodeSub vf.d
getPreviousSub() => org.GL.client.NodeSub vf.f

NodeSubQueue:
hua implements org/GL/client/NodeSubQueue
getCurrent() => org.GL.client.NodeSub hua.b
getTail() => org.GL.client.NodeSub hua.a

OpenGLModel:
nea implements org/GL/client/OpenGLModel

OpenGLRender:
mk implements org/GL/client/OpenGLRender

Reference:
ao implements org/GL/client/Reference
getIndex() => int ao.g

Render:
l implements org/GL/client/Render

SoftReference:
tea implements org/GL/client/SoftReference
getReference() => java.lang.ref.SoftReference tea.h

SoftwareModel:
p implements org/GL/client/SoftwareModel

SoftwareRender:
g implements org/GL/client/SoftwareRender

StatusNode:
uca implements org/GL/client/StatusNode
getNext() => org.GL.client.StatusNode uca.a
getPrevious() => org.GL.client.StatusNode uca.b

StatusNodeList:
ln implements org/GL/client/StatusNodeList
getHead() => org.GL.client.StatusNode ln.b
getNext() => org.GL.client.StatusNode ln.a

StatusNodeSub:
af implements org/GL/client/StatusNodeSub
getNextSub() => org.GL.client.StatusNodeSub af.c
getPreviousSub() => org.GL.client.StatusNodeSub af.d

TileData:
xa implements org/GL/client/TileData
getHeights() => int[][] xa.j

Viewport:
hu implements org/GL/client/Viewport
getXX() => float hu.j
getXY() => float hu.f
getXZ() => float hu.a
getXOff() => float hu.b
getYX() => float hu.e
getYY() => float hu.i
getYZ() => float hu.c
getYOff() => float hu.g
getZX() => float hu.k
getZY() => float hu.l
getZZ() => float hu.m
getZOff() => float hu.h

23.524 seconds.

Flight

2012-01-23 05:50:32

From: ProRa
I give u permission to use my hooks as soon as you send me the source ;)


Hm…

http://pastebin.com/pt6XiKZM
http://rs-hacking.com/showthread.php?pid=5724

ProRa

2012-01-23 06:17:06

From: Flight
Hm…

http://pastebin.com/pt6XiKZM
http://rs-hacking.com/showthread.php?pid=5724


so?

Kyle Undefined

2012-01-23 09:12:05

From: ProRa
so?


You're taking credit for others works it looks like.

Imanoobbot

2012-03-24 17:06:27

Looks really good so far. But i think you should make the mouse moving more Humanlike cause it seems to be very robotic.

Imanoobbot

2012-03-25 21:00:35

From: Flight
Hm…

http://pastebin.com/pt6XiKZM
http://rs-hacking.com/showthread.php?pid=5724



Haha Fail ;)

Frement

2012-03-26 14:24:31

Here are a few links you could look at when experimenting with OpenGL (Most of the credits however go to silentwolf).

opengl32.cpp
opengl32.h

I also had some position ideas etc, but if you get anything great out of those, please keep me updated via PM :)

l3g3nds

2012-05-30 16:12:58

Man I would really like to learn how to bot with java since I know java really well but I don't really understand how to use Robot