Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Guild Wars > GW Guides & Templates
You last visited: Today at 02:41

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

Advertisement



[Guide] - Coding a GW Bot

Discussion on [Guide] - Coding a GW Bot within the GW Guides & Templates forum part of the Guild Wars category.

Reply
 
Old 11/22/2014, 17:07   #91
 
elite*gold: 0
Join Date: Jan 2010
Posts: 10
Received Thanks: 1
Lohnt es sich noch nen bot auf tt6 Basis zu schreiben?
Oder sollte ich auf GWCA setzen?
Jirai Gumo is offline  
Old 11/23/2014, 23:37   #92


 
elite*gold: 144
Join Date: Aug 2010
Posts: 69
Received Thanks: 9
Quote:
Originally Posted by Jirai Gumo View Post
Lohnt es sich noch nen bot auf tt6 Basis zu schreiben?
Oder sollte ich auf GWCA setzen?
Du solltest mit gwa2 coden
1328™ is offline  
Old 11/28/2014, 07:27   #93
 
elite*gold: 0
Join Date: Jan 2010
Posts: 10
Received Thanks: 1
Ja habs schon mitbekommen
Klappt soweit sehr gut
Jirai Gumo is offline  
Old 01/11/2015, 21:22   #94
 
joubengosu's Avatar
 
elite*gold: 106
Join Date: Nov 2011
Posts: 152
Received Thanks: 11
An english version will be great
joubengosu is offline  
Old 06/12/2020, 16:45   #95
 
elite*gold: 0
Join Date: Sep 2017
Posts: 14
Received Thanks: 2
Kann man diese Anleitung auch auf GWA2 adaptieren, oder gibt's da besonderheiten oder eine andere Anleitung?
0815Storm is offline  
Old 06/15/2020, 10:09   #96
 
elite*gold: 0
Join Date: May 2019
Posts: 18
Received Thanks: 5
Quote:
Originally Posted by Syc0n View Post
Coding a GW Bot
featuring the tt6

Falls fragen aufkommen, einfach fragen, schließlich ist dazu ein Forum da
Hello !

Sorry to bother you, but do you have an english/french version ? Your tuto looks awesome, but i can't read german
zolf02 is offline  
Old 06/30/2020, 01:02   #97
 
elite*gold: 0
Join Date: Jun 2019
Posts: 7
Received Thanks: 21
Hope the author is okay with me sharing this. I translated and lightly formatted the original post in Markup, but the forum doesn't support it. Here's the unformatted text. Hope this helps.





Quote:

Coding a GW Bot

featuring the tt6

In this guide, I will share my knowledge of bot coding with you. From the GUI to the finished bot, I will describe everything in detail. The whole thing will be explained using an example bot, the Sanctum Cay Bot.

Table of contents

1. programs

2. preparation

3. GUI (Graphical User Interface)

4. includes

5. variables

6. hotkeys

7. the way

8. the farm part

9. the main function

1. programs

AutoIT v3

Scite (AutoIT extension)

2. preparation

For the sake of clarity, you should create a folder with the name of the bot before each bot code. In my example "Sanctum Cay Bot 1.0", because the bot farms from the reef of silence. There are no limits to creativity, but the name should have a certain recognition value. Shortly after creating the folder, the main cores of a human-looking bot must be included. To one the NomadMemory.au3 ,with which you can read/write the GW process and their memory addresses. On the other hand the newest Moveto from tonitusch666, consisting of the two files: tt6.ini and tt6.au3. With the MoveTo, the bot can be given a smooth, humane path. The dumper is also quite useful for finding out the addresses, but can also be deleted afterwards. But since the MoveTo works with memory addresses we need an Update.ini which contains the current memory addresses.

Explanation of the Update.ini

Odds:

;Update.ini

[SECTION 9-A]

DEATH = 0xa0d204

This address is used for the death check. With a \_Memoryread(0xa0d204,$hprocess) the address prints 1 in case of death, otherwise 0, alive.

CAMCOURSEB = 0xa0d0c8

This is used to read out the direction and angle of the camera view.

[SECTION D]

POSX = 0xd30a44

POSY = 0xd30a48

The most important requirement for the MoveTo. You can imagine these addresses as in a coordant system with the x and y axes. The bot moves to these points.

CHECK\_MAP = 0xd306e0

The Check\_Map address shows in which area in GW you are currently located. The result of the readout is the following:

0 = Outpost/city

2 = loading screen

1 = Area
But since the memory addresses change after each update, you have to find them yourself with the cheat engine (->Tut from NBA)

or you can share the values with other users. After an update, I myself write the new memes in the meme collection thread.

3. GUI (Graphical User Interface)

A GUI is a graphical user interface that should definitely make it easier for the user to operate the bot. There is no point in adding a million functions if outsiders do not understand them.

To create a GUI you first have to create an AutoIT file in your folder (here: Sanctum Cay Bot 1.0) (right mouse-click-\> New-\> AutoIt v3 Script). Right click on this script and go to "edit Script". Now your script appears, which should only contain the standard comment. For creating the GUI's there is the Koda(FormDesigner), to be found under Tools. Now the Koda FormDesigner opens. Here you can play around a little bit.

With F10 you can see how the GUI should look like and with F9 the default code for the GUI appears. You should copy this code into your AutoIt-Script. A more explicit Tut will follow, but for now I only have this GUI:

Code from the Form Designer:

PHP code:

#include <ButtonConstants.au3>

#include <EditConstants.au3>

#include <GUIConstantsEx.au3>

#include <StaticConstants.au3>

#include <WindowsConstants.au3>

#Region ### START Koda GUI section ### Form=

$Bot = GUICreate("Sanctum Cay Bot", 256, 190, 193, 125)

$Start = GUICtrlCreateButton("Start", 64, 96, 113, 65, 0)

$Check_Sell = GUICtrlCreateCheckbox("Sell after", 24, 16, 65, 17)

$Check_Place = GUICtrlCreateCheckbox("Place Money", 24, 40, 81, 17)

$Input_Sell = GUICtrlCreateInput("", 104, 16, 33, 21)

$Label1 = GUICtrlCreateLabel( Round, 144, 16, 42, 17)

$Input_Place = GUICtrlCreateInput("", 104, 40, 33, 21)

$Label2 = GUICtrlCreateLabel( Round, 144, 40, 42, 17)

GUISetState(@SW_SHOW)

#EndRegion ### END Koda GUI section ###

While 1

$nMsg = GUIGetMsg()

Switch $nMsg

Case $GUI_EVENT_CLOSE

Exit

EndSwitch

WEnd
Explanation:

First, the GUI includes all the includes that are important for itself. Then the various components are created and stored in a variable so that they can be queried later. With the While-command it is queried all the time, if something in the GUI has been pressed, changed.

PHP code:

Case $GUI_EVENT_CLOSE

Exit
-> means that if "X" is pressed in the GUI, the bot will close.

4. includes

Includes allow other scripts to be included in your bot. This is done with the command "#include". The most important script for your bot, tt6.au3, should be included:

PHP code:

#include "tt6.au3"
<- This must be in exactly the same

PHP code:

#include-once

#include "tt6.au3"

#include \<ButtonConstants.au3\>

#include \<EditConstants.au3\>

#include \<GUIConstantsEx.au3\>

#include \<StaticConstants.au3\>

#include \<WindowsConstants.au3\>
With the command #inlcude-once the scripts are all included only once, as it should be.

5. variables

In most cases variables are used to store data. These are marked with a $ in AutoIt. Before every bot, variables used in the script must be declared. Since they should be available in the whole script, you should declare them with global before, but it is not a must.

In our example Bot: The rounds after which the money should be put down ($RundenP) -- and the rounds after which you sell ($RundenS).

PHP code:

Global $RundenS = 0, $RundenP = 0
--> Since the laps at the start of the bot are also 0.

6. hotkeys

Many bots use hotkeys to hide, stop or pause the bot. Hotkeys are assigned with the HotKeySet command. In our example bot I only use the Exit Hotkey:

PHP code:

Hotkeyset("{F1}", "End")
--> If F1 is pressed now at the bot the function "End" is called.

But since we have not yet created the function End we will do this:

PHP code:

Func End()

Exit

EndFunc
--> Function to terminate the bot.

The previous code looks like this:

PHP code:

\#include-once

\#include "tt6.au3"

\#include \<ButtonConstants.au3\>

\#include \<EditConstants.au3\>

\#include \<GUIConstantsEx.au3\>

\#include \<StaticConstants.au3\>

\#include \<WindowsConstants.au3\>

Global $RoundsS = 0, $RoundsP = 0

Hotkeyset("{F2}", "End")

\#Region \#\#\# START Koda GUI section \#\#\# Form=

$Bot = GUICreate("Sanctum Cay Bot", 256, 190, 193, 125)

$Start = GUICtrlCreateButton("Start", 64, 96, 113, 65, 0)

$Check\_Sell = GUICtrlCreateCheckbox("Sell after", 24, 16, 65, 17)

$Check\_Place = GUICtrlCreateCheckbox("Place Money", 24, 40, 81, 17)

$Input\_Sell = GUICtrlCreateInput("", 104, 16, 33, 21)

$Label1 = GUICtrlCreateLabel( Round, 144, 16, 42, 17)

$Input\_Place = GUICtrlCreateInput("", 104, 40, 33, 21)

$Label2 = GUICtrlCreateLabel( Round, 144, 40, 42, 17)

GUISetState(@SW\_SHOW)

\#EndRegion \#\#\# END Koda GUI section \#\#\#

While 1

$nMsg = GUIGetMsg()

Switch $nMsg

Case $GUI\_EVENT\_CLOSE

Exit

EndSwitch

WEnd

Func End()

Exit

EndFunc
My order is actually always as follows:

Includes-> Global Variables -> Hotkeys -> GUI -> GUI/Hotkey relevant functions -> Bot-Code

7. the way

Now the bot-coding starts:

First we have to figure out what the bot should do. First of all, it should leave the reef of silence, farm, resign, check if it should be sold or discarded, and start over again. Since this is also only a small bot, which is hardly/not at all profitable, the preliminary consideration is also shorter.

As mentioned above, we use the MoveTo function. But this function needs coordinates which we should find out before with the dumper. Therefore we open GuildWars, travel to the desired point (here: Reef of Silence) and fire up the dumper. The dumper shows us a bunch of numbers, of which only the first 4 are decisive for us. The first two numbers (x and y) show the position of the mouse in the Gw window and the next two numbers (x and y) show our coordinates which we need for our MoveTo.

But because the MoveTo only runs if a prepmoveto() was used before we start our bot script with the following function:

PHP code:

Func goout()
prepmoveto()
Now we should check our spawnpoints, so that the bot takes the right way from the right point. To do this we have to travel into the reef again and again to determine every spawn coordinate. So we press "0" at a spawn point in the Numpad, so that the dumper saves the current coordinates in a text file (dump.txt) (e.g. MoveTo(1, -21202, 4918)). But we want to see if we are at this point and don't run to it, so we delete the MoveTo(1, and replace it with a Checkarea(x,y) (e.g.: Checkarea(-21202, 4918))

-> this checks whether you are at the desired position.

Now we have our first checkarea point. But it is questionable if we are at this point again after a resignation or similar. Therefore we build in an if-function to ask where we are at the moment. Times in German:

PHP code:

Func goout()
prepmoveto()
If Checkarea(-21202, 4918) Then
So if our bot is at the desired location, it should start running, but where? I'd say to the exit, which is why we move our char towards the portal, while we use 0 to save the coordinations at greater intervals.

From the Dumper.txt we now take the following data:

MoveTo(1, -21489, 5066)

MoveTo(1, -21825, 5429)

MoveTo(1, -22063, 6039)

MoveTo(1, -22270, 6447)

MoveTo(1, -22688, 6909)

which we should build into our function:

PHP code:

Func goout()

prepmoveto()

If Checkarea(-21202, 4918) Then

MoveTo(1, -21489, 5066)

MoveTo(1, -21825, 5429)

MoveTo(1, -22063, 6039)

MoveTo(1, -22270, 6447)

MoveTo(1, -22688, 6909)
This is our first way to the portal. But there are several spawn points...

So we change districts and start over.

Checkarea

MoveTo(1, -22165, 4897) --> Checkarea(-22165, 4897)

Path

MoveTo(1, -22137, 5442)

MoveTo(1, -22144, 6100)

MoveTo(1, -22220, 6324)

MoveTo(1, -22448, 6632)

MoveTo(1, -22707, 6901)

Extend script:

PHP code:

Func goout()

prepmoveto()

If Checkarea(-21202, 4918) Then

MoveTo(1, -21489, 5066)

MoveTo(1, -21825, 5429)

MoveTo(1, -22063, 6039)

MoveTo(1, -22270, 6447)

MoveTo(1, -22688, 6909)

ElseIf Checkarea(-22165, 4897) Then

MoveTo(1, -22137, 5442)

MoveTo(1, -22144, 6100)

MoveTo(1, -22220, 6324)

MoveTo(1, -22448, 6632)

MoveTo(1, -22707, 6901)
And again:

PHP code:

Func goout()

prepmoveto()

If Checkarea(-21202, 4918) Then

MoveTo(1, -21489, 5066)

MoveTo(1, -21825, 5429)

MoveTo(1, -22063, 6039)

MoveTo(1, -22270, 6447)

MoveTo(1, -22688, 6909)

ElseIf Checkarea(-22165, 4897) Then

MoveTo(1, -22137, 5442)

MoveTo(1, -22144, 6100)

MoveTo(1, -22220, 6324)

MoveTo(1, -22448, 6632)

MoveTo(1, -22707, 6901)

ElseIf Checkarea(-22040, 6359) Then

MoveTo(1, -22291, 6590)

MoveTo(1, -22782, 7012)

EndIf
If checkarea(x,y) then ...

If else Checkarea(x,y) then ...

End- If
<-- roughly translated

after the bot has arrived shortly before the portal, a keepmoveto() is ordered again, so that the bot runs further into the portal. When it has arrived at the portal, the load screen opens, i.e. the loadout function must be called. I have already integrated this into tt6.au3.

PHP code:

Func loadout()

While \_memoryread($memmap, $hprocess) \<\> 1

Sleep(500)

WEnd

Sleep(10000)

EndFunc
<-- While the load screen is active, the script "sleeps" until the load screen is at 100%. After that, it waits another 10 seconds.

PHP code:

Func goout()

prepmoveto()

If Checkarea(-21202, 4918) Then

MoveTo(1, -21489, 5066)

MoveTo(1, -21825, 5429)

MoveTo(1, -22063, 6039)

MoveTo(1, -22270, 6447)

MoveTo(1, -22688, 6909)

ElseIf Checkarea(-22165, 4897) Then

MoveTo(1, -22137, 5442)

MoveTo(1, -22144, 6100)

MoveTo(1, -22220, 6324)

MoveTo(1, -22448, 6632)

MoveTo(1, -22707, 6901)

ElseIf Checkarea(-22040, 6359) Then

MoveTo(1, -22291, 6590)

MoveTo(1, -22782, 7012)

EndIf

keepmoveto()

loadout()

EndFunc
8. the farm part

This concludes our output function. Now it comes to the

Farming part

Since the opponents are right at the beginning it doesn't make sense to use extra MoveTo's from my point of view. With the command Keysend(" "), which is also included in tt6.au3, virtual keystrokes can be pressed very easily. So our bot starts moving to the enemies (with "c" and "space"). Because the bot now has to run a little bit, we build in a sleep time until the bot has arrived at the enemies.

PHP code:

Func fight()

keysend("c")

Sleep(200)

keysend("space")

Sleep(20000)
After that the bot should kill the enemies. The SKills 1,2 and 3 are used for this. Also between these cast times sleep times have to be inserted again.

PHP code:

Func fight()

keysend("c")

keysend("space")

sleep(20000)

keysend("1")

sleep(1500)

keysend("2")

sleep(1500)

keysend("2")

sleep(2400)
Now the enemies should be killed and the drops must be lifted. For this we use a For ... next function

PHP code:

For $i = 0 to 2

keysend("o")

Slp(60)

keySend("space")

Slp(600)

next
-> For the variable i,whichis0,thefollowingcommandsareexecuteduntili = 2

PHP code:

Func fight()

keysend("c")

keysend("space")

sleep(20000)

keysend("1")

sleep(1500)

keysend("2")

sleep(1500)

keysend("2")

sleep(2400)

For $i = 0 to 2

keysend("o")

Slp(60)

keySend("space")

Slp(600)

next
After 2x attempts to pick up items, the bot should resign. This is done with the resign() - function from tt6. After the bot has clicked the "Back to Outpost" button, we have to wait for the loading time again. This time with Loadin(), because we are travelling to an outpost. Since the run is finished after that, we add +1 to the two variables $RundenP/S.

Func fight()

keysend("c")

keysend("space")

sleep(20000)

keysend("1")

sleep(1500)

keysend("2")

sleep(1500)

keysend("2")

sleep(2400)

For $i = 0 to 2

keysend("o")

Slp(60)

keySend("space")

Slp(600)

next

resign()

loadin()

$RoundsS += 1

$RoundsP += 1
The bot uses the resign() function from the tt6 at the end. Now you can search for "Func resign()" in the tt6.au3 and then it says

odds:

Func resign($wdelay = 50)

$cnt = 0

Thu

keysend("-")

Sleep($wdelay)

keysend("r")

Sleep($wdelay)

keysend("e")

Sleep($wdelay)

keysend("s")

Sleep($wdelay)

keysend("i")

Sleep($wdelay)

keysend("g")

Sleep($wdelay)

keysend("n")

Sleep($wdelay)

keysend("RETURN")

RndSleep(5500)

$cnt +=1

Until (\_memoryread($memdeath,$hprocess) = 1) Or $cnt \>3

ControlClick($client, "", "", "left", 1, $DTclickX, $DTclickY)

EndFunc
At the end of the control click is responsible for the "Return" - button. The positions are declared as DTClick above, see:

Odds:

Const $DTclickX = Int(IniRead("tt6.ini", "click positions", "DTclickX",0))

Const $DTclickY = Int(IniRead("tt6.ini", "click positions", "DTclickY",0))
To change the click position, you go into tt6.ini and write in your coordinates at DTclickX and DTclickY, which you can find out with the dumper.

9. the main function

Up to this point we have completed our functions goout() & fight(). Now we have to call these functions, but also check if we want to sell or put the gold in the chest.

We do this best in a new function: Main()

PHP code:

Func Main()

While 1

If Guictrlread($Check\_Sell) = 1 Then

If Guictrlread($Input\_Sell) = $RundenS Then GoSell()

EndIf

If Guictrlread($Check\_Place) = 1 Then

If Guictrlread($Input\_Place) = $RundenP Then GoPlace()

EndIf

Goout()

Farm()

Turnaround

EndFunc
--> explanation:

With GuiCtrlRead we read out whether the checkbox was activated. If it has been activated, we also want to check if the rounds after which we want to sell/deposit are the same as those from the GUI.

Then we execute the two functions.

Attention

The functions GoSell() and GoPlace() I did not include on purpose, because if you understand everything, you should be able to do it yourself. Also I did not insert the current Update.ini on purpose!

Nevertheless I hope I could give you a little insight into the bot-coding with the tt6 and wish you a lot of fun.

If you have any questions, just ask, after all there is a forum for that
spartanfbj is offline  
Old 03/28/2022, 18:22   #98
 
elite*gold: 0
Join Date: Aug 2017
Posts: 88
Received Thanks: 11
I am bumping this thread
Santa Clauz is offline  
Old 05/08/2022, 20:16   #99
 
elite*gold: 0
Join Date: Jul 2008
Posts: 78
Received Thanks: 12
Nice legacy we got there
lemoutondu10 is offline  
Reply

Tags
gw bot


Similar Threads Similar Threads
[Guide] Coding for CoEmu/Cofuture
05/12/2011 - CO2 PServer Guides & Releases - 36 Replies
CONTENTS OF THREAD: - Creating Ingame Commands and Database Functions saving/loading/updating databases using SQL - Coding more advanced Npcs for use on your server - Timers and processes (By Yashi) - Data types in C# and what they can hold
Beginner Guide in Macro/Bot Coding [just a preview]
12/04/2008 - GW Bots - 18 Replies
Hallo allezusammen. Ich schreibe jetzt schon seit einiger Zeit an einem Guide, welcher euch einen kleinen Einblick in das Thema "Macro/Bot coding" bringen soll. Er ist noch nicht fertig weil ich den dazugehörigen Bot noch nicht fertiggestellt habe (@gispy: Den, den ich dir geschickt habe). Also wird bis zum fertigen release noch ein bisschen Zeit vergehen. Aber, ich denke mir mal, vielleicht können ein paar Leute schon etwas damit anfangen. Um die Fragen zu beantworten, die mir...



All times are GMT +2. The time now is 02:41.


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.