Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Conquer Online 2 > CO2 Guides & Templates
You last visited: Today at 22:30

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Making bots/macros in VisualBasic 6.0

Discussion on Making bots/macros in VisualBasic 6.0 within the CO2 Guides & Templates forum part of the Conquer Online 2 category.

Reply
 
Old 12/07/2006, 21:01   #16
 
elite*gold: 0
Join Date: Apr 2006
Posts: 22
Received Thanks: 0
Dude.. i get urs yeh.. i load up conquer. i load the auto scatter up BUT it doesnt do anything.. =\ my pc jus ****** up or do i gotta be a certain res? or..? sorry man that was jus the last noob question i promise =X
tasshu is offline  
Old 12/07/2006, 21:31   #17
 
elite*gold: 0
Join Date: Apr 2006
Posts: 22
Received Thanks: 0
nvm thanks for telling me on co xD ( soz for doub... TRIPPLE!! >.< posts )
tasshu is offline  
Old 12/07/2006, 22:17   #18
 
elite*gold: 0
Join Date: Aug 2006
Posts: 100
Received Thanks: 1
Quote:
Originally posted by inSertCoiN@Dec 7 2006, 16:51
I'm not realy good at manipulating with CO memory, expecialy not DMA. I will only show you how to create macros and manipulating CO with pixel based coding (wich can be used to make pixel-based bot). Also I will show you how you can use some static CO memory data based on .

VB 2005 express is lil diferent from VB 6.0 but you can find tutorials on the internet how to adapt the code.
Once again I would like to encourage all the VB coders out here to go publik with theyr work.

*source code uploaded*
Making pixel-based bots is a start. Thx m8, I'll get right on it.

Oh and VB 2005 express updates the code for me. way cool. I've lookd over it and it seems pretty easy. Now to play around with it and try differant thing to c wat my limitations are. Any idea how things like in, COtobo, dropping ores with inv window closed and like loading new arrows with out arrows being in hotkey slot or inv not being open. I assume these things can't be done just with pixel based botting cause it looks for pixes and clicks where u tell it to. So I think it has something to do with send a packet thats says drop this ore. So to do this I would have to have a packet sniffer running drop a ore and see wat packet was sent and copy that and send the packet through VB some how to make this work. Correct me if I'm wrong anywhere. And can someone explain to me how to do this. If I can see one packet be sent and see how to send the packet through VB thenI can do others and figure out how to do things .


Ok I been playing with the code and its all pretty simple. Can u make a simple bot to click on something in game. Mabye where it has to find the object .
Bud_wis_er_420 is offline  
Old 12/08/2006, 10:02   #19
 
elite*gold: 0
Join Date: Mar 2005
Posts: 251
Received Thanks: 115
Quote:
Originally posted by Bud_wis_er_420@Dec 7 2006, 22:17
Any idea how things like in, COtobo, dropping ores with inv window closed and like loading new arrows with out arrows being in hotkey slot or inv not being open. I assume these things can't be done just with pixel based botting cause it looks for pixes and clicks where u tell it to.

Ok I been playing with the code and its all pretty simple. Can u make a simple bot to click on something in game. Mabye where it has to find the object .
As far as I know COtobo works with memory reading and code injecting, not sending packets. Sadly I still haven't figured those thing out but when/if I do i'll make them public .

Well wait few days and i'll release an "AutoOreDroper". Sadly this one is pixelbased and only only works on 1 CO window but it does the things you are searching for (checks for pixels and cliks).
inSertCoiN is offline  
Old 12/08/2006, 16:01   #20
 
elite*gold: 0
Join Date: Aug 2006
Posts: 100
Received Thanks: 1
Thx alot m8. Looking forward to it. Meanwhile I'll be getting better acquainted with VB. which vers of VB is newer VB 6 or VB studio 2005?
Bud_wis_er_420 is offline  
Old 12/08/2006, 17:01   #21
 
elite*gold: 0
Join Date: Mar 2005
Posts: 251
Received Thanks: 115
Quote:
Originally posted by Bud_wis_er_420@Dec 8 2006, 16:01
Thx alot m8. Looking forward to it. Meanwhile I'll be getting better acquainted with VB. which vers of VB is newer VB 6 or VB studio 2005?
VB studio 2005 is newer...

...on second thought I'll first release my CO medic...
It has this futures:
1. Autouses potions when healthbar reaches certan point. (wich you specify)
2. Open Vanilla box when there is only 1 potion left.
3. Uses spiritual healing wich is placed on hotkey when stamina is full. (reads stamina from memory)
4. Shows the map ID and there are some maps with names added like tactics. (so when u enter a certain tactic it will tell you wich tactic are you in).

I need to reference the code so that you'll know wich line does what so i'll release it in 2-3 days.
inSertCoiN is offline  
Old 12/08/2006, 20:52   #22
 
elite*gold: 0
Join Date: Aug 2006
Posts: 100
Received Thanks: 1
Can't wait
Bud_wis_er_420 is offline  
Old 12/11/2006, 00:04   #23
 
elite*gold: 0
Join Date: Aug 2006
Posts: 100
Received Thanks: 1
have u had a chanse to get the Co medic for me yet. I'm having a problem on figuring out how to bring the CO window process to the forground. And how to decide if its in 800X600 mode or the other. Because if in 800X600 the pixel cords be different. And lets say someone has there CO client in 800X600 widow mode. How do I make it where the pixels start on the client and not the computer screen.
Example here:
And how do I tell wether the clent is in 800X600 mode or the 1024X768 mode. A simple if statment can change the needed code to switch. I'm anxious to get started and these are the things i need to know to get me started.

Btw +1k for all the help you've given me.
Bud_wis_er_420 is offline  
Old 12/11/2006, 02:08   #24
 
elite*gold: 0
Join Date: Mar 2005
Posts: 251
Received Thanks: 115
A felow coder asced me on PM what way would I use to pixelcheck thro whole screen.
I'll post my answer here as some felow coders might find it usefull:


I would do something like this...

Dim xScr, yScr as Integer
xScr=0
yScr=0

Do While yScr < *screen height*+1
*do here what you want with the pixel*
xScr=xScr+1

if xScr > *screen wight* then
xScr=0
yScr=yScr+1
end if

loop

The thing is that if you check every pixel it will take forever, and you need pixelcheck that will end in at least 1 sec on average computer. ...so if you plan on coding a bot you shold develope an more advance pixel check...
1. Dont check the whole screen, check only a box in the midle of screen where usualy your caracter is (around your character).
2. If you plan to search for monsters your best option is the red healthbar. Because the healthbar is preety long you can check, lets say, every 5th Pixel. in x line, on every 3rd y line.
3. Use method for direct pixel check, if you capture the screen 1st and then check it will take forever.

If i have time I might start coding a pixel bot. If I do i'll probably go opensource so that all VB coders here can work on him and give ideas so that we can make it the best .
inSertCoiN is offline  
Old 12/11/2006, 02:20   #25
 
elite*gold: 0
Join Date: Mar 2005
Posts: 251
Received Thanks: 115
Quote:
Originally posted by Bud_wis_er_420@Dec 11 2006, 00:04
have u had a chanse to get the Co medic for me yet. I'm having a problem on figuring out how to bring the CO window process to the forground. And how to decide if its in 800X600 mode or the other. Because if in 800X600 the pixel cords be different. And lets say someone has there CO client in 800X600 widow mode. How do I make it where the pixels start on the client and not the computer screen.
Example here:
And how do I tell wether the clent is in 800X600 mode or the 1024X768 mode. A simple if statment can change the needed code to switch. I'm anxious to get started and these are the things i need to know to get me started.

Btw +1k for all the help you've given me.
1. If you realy need a code that checks the screen res I can find it for you but I sugest to make your bot/macro for 1 screen resolution because you will have to doublewrite the coordinates and it will take lots of work. I make/going to make my programs for 1024*768 and state that they only work on that resolution.
2. In my medic I will show you how to get pixel from the client by hes name, even if its not infront, but your CO will have to be infront anyway because of the mouse/keyboard controls that the program is going to send. Sorry for the delay on the release but I have some diferent work atm, I will release it as soon as I can. I would like to release it full referenced so that you know "what does what".
inSertCoiN is offline  
Old 12/11/2006, 04:25   #26
 
elite*gold: 0
Join Date: Aug 2006
Posts: 100
Received Thanks: 1
Well the thing is yes for now I will make my bots one res just for personal use but when i want to release it it will need to be multi purpose. Let me show u an example of what I'm talking about.
This is SCAR (You may have heard of it, It's a pascal compiler made for the game runescape) When u open it you will see a crosshairs in the tool box area. Click this and drag to any window. Then press Ctrl+Alt+p to open a color picker. and move your mouse to the 0,0 position of the window you picked. you see on the SCAR compiler the at the bottom what your curent cords are. There is also a automatic way to do this I could make a procedure to do it for me, like this:
Code:
program New;
begin
FindWindow&#40;'New Text Document - Notepad'&#41;
ActivateClient;
Sendkeys&#40;'It found your new note pad doc and now it will save it'&#41;
end.
Open a new txt doc and copy paste the above script to the compiler window and press the play button to run it.

Now, the function FindWindow(); and the procedure ActivateClient; is a prebuilt into SCAR, but I want to make one like this for VB



Oh and for fun check out some of my old scripts In the list in the link above
Bud_wis_er_420 is offline  
Old 12/11/2006, 10:44   #27
 
yaoyeng's Avatar
 
elite*gold: 20
Join Date: May 2006
Posts: 734
Received Thanks: 164
Quote:
At the begining sorry for my bad speling...
I decided to contribute to the comunity and help some people wich are begining to program in VB with some usefull stuff I know. Also I would like to encurage all the VB programers in this forum to post programs and short tutorials in this topic so that we make a good usefull VB library

I will start with small programs and go big and add new tool with tutorial when I have time. If this topic spreads in more pages list thro them all because I will post new tools with How To in diferent posts. I hope my work will be found usefull and will help some coding beginers.
--------------------------------------------------------------------------

Program no.1: AutoScater

1. Open new project and add new module. In the module paste this.

QUOTE
Public Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer

Option Explicit
Public Declare Sub mouse_event Lib "user32" (ByVal dwFlags As Long, ByVal dx As Long, ByVal dy As Long, ByVal cButtons As Long, ByVal dwExtraInfo As Long)
Public Declare Function SetCursorPos Lib "user32" (ByVal X As Long, ByVal Y As Long) As Long

Public Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
Public Const MOUSEEVENTF_LEFTDOWN = &H2
Public Const MOUSEEVENTF_LEFTUP = &H4
Public Const MOUSEEVENTF_MIDDLEDOWN = &H20
Public Const MOUSEEVENTF_MIDDLEUP = &H40
Public Const MOUSEEVENTF_RIGHTDOWN = &H8
Public Const MOUSEEVENTF_RIGHTUP = &H10
Public Const MOUSEEVENTF_MOVE = &H1

Public Type POINTAPI
X As Long
Y As Long
End Type

Public Function GetCurrentX() As Long
Dim Position As POINTAPI
GetCursorPos Position
GetCurrentX = Position.X
End Function

Public Function GetCurrentY() As Long
Dim Position As POINTAPI
GetCursorPos Position
GetCurrentY = Position.Y
End Function

Public Sub LeftClick()
LeftDown
LeftUp
End Sub

Public Sub LeftDown()
mouse_event MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0
End Sub

Public Sub LeftUp()
mouse_event MOUSEEVENTF_LEFTUP, 0, 0, 0, 0
End Sub

Public Sub MiddleClick()
MiddleDown
MiddleUp
End Sub

Public Sub MiddleDown()
mouse_event MOUSEEVENTF_MIDDLEDOWN, 0, 0, 0, 0
End Sub

Public Sub MiddleUp()
mouse_event MOUSEEVENTF_MIDDLEUP, 0, 0, 0, 0
End Sub

Public Sub MoveMouse(xMove As Long, yMove As Long)
mouse_event MOUSEEVENTF_MOVE, xMove, yMove, 0, 0
End Sub

Public Sub RightClick()
RightDown
RightUp
End Sub

Public Sub RightDown()
mouse_event MOUSEEVENTF_RIGHTDOWN, 0, 0, 0, 0
End Sub

Public Sub RightUp()
mouse_event MOUSEEVENTF_RIGHTUP, 0, 0, 0, 0
End Sub




The first GetAsyncKeyState function is used to get the current state of a key. This works with any key on keyboard as well as with the mouse.
The mouse_event and SetCursorPos are used to control the mouse. GetCursorPos is used to return you the curent position of your mouse.
How to control the mouse? Lets say you want to move the cursol to pixel coordinates 500, 500 and click. You simply call...
QUOTE
MoveMouse 500, 500
LeftClick

Also see the other functions in the module... you can use any like midle click,right click ect. More about mouse control in next tutorials. Now lets return to our AutoScater.

On the main form add a timer and set its "Interval" value to 150. This will call the code under timer every 0.15 sec, In our case will autoclick if you hold the right button every 0.15 sec. I set it to so low because i dont know the minimum time between 2 scaters and I dont want to miss any 0.1 sec
Now under timer add this code:
QUOTE
Private Sub timMain_Timer()
result = GetAsyncKeyState(vbKeyRButton) 'gets the state of the right mouse button
If result = -32768 Then 'if its down
RightUp 'release it
RightDown 'and return it down again untill you release it in reality
End If
End Sub



Edit: not to confuse any1, the timer should be renamed to "timMain" or replace the "timMain" in the above code with "Timer1".

Now compile and vala... you have an AutoScater wich will constantly press righ mouse button whyle you hold it.
I hope this helped some people... More will come
cool, thx for teaching..
yaoyeng is offline  
Reply


Similar Threads Similar Threads
The FULL guide to making your own Bots/Macros...PART 2
02/20/2011 - CO2 Guides & Templates - 30 Replies
Part 2 Hi all, This is the second guide to making your own Bots and Macros using the script writer AutoIt. I have explained basic fundamentals in my previous Basic Guide on how to create Bots and Macros for Conquer and I will be further sharing my knowledge on how to create bots using Mouse Clicks and GUI for your programs. Contents: 1. AutoIt Window Info 2. Mouse Functions
The FULL guide to making your own Bots/Macros...PART1
04/19/2008 - CO2 Guides & Templates - 27 Replies
Part 1 Hi all, As you have read in the thread title, this is a FULL guide for creating your own Bots and Macros. I will be teaching you some of the basic fundamentals in programming and also some advanced fundamentals which will include creating GUI's for your Bots and Macros. Advanced fundamentals will be in the 2nd Part of this tutorial. Contents: 1. What we are using 2. Introduction to the AutoIt language



All times are GMT +2. The time now is 22:30.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.