Kab-Bot Script TUT - Begginer

05/10/2011 20:49 owndotcom#1
The stickey for this rather fantastic bot is overrun with people asking for help with the scripting instead of learning it on thier own, so I figured I'd give a beginner's look at the syntax so that newbs will get a better idea of how to write their own scripts.

So, let's get started. Each command is separated by a comma ( , ) and each parameter for a command is separated by a semicolon( ; ).

Take the following scripts for example:

Find a target and spam skills
Code:
u,1,2,3,4,5,6,7
EXPLANATION:
- 'u' targets the closest mob
- '1,2,3,4,5,6,7' spams the skills in slots 1-7
- there are a total of 8 commands in this script
- this will continually try to target and attack any mobs that get close enough to you to target


Find a target and spam skills (only if a target is acquired)
Code:
u,
iscol;<color code>;<x-coordinate>;<y-coordinate>,
1,2,3,4,5,6,7,
endis;l,
EXPLANATION
- 'u' targets the closest mob
- 'iscol' is a conditional command with 3 parameters...Color Code, X-coordinate, and Y-coordinate. Basically what this is saying is "If the color at X-Y point on the screen equals the specified color then do the commands inside iscol/endis
- the Color Code and X-Y coordinates in the 'iscol' command represent a UNIQUE COLOR and coordinate on the target box that appears to show you the mob you have targetted. The 'iscol' command means NOTHING without these coordinates matching the colors on YOUR screen.
-'endis' closes the 'iscol' command
-'l' loops the 'iscol' command until there is no more target
- '1,2,3,4,5,6,7,' spams skills in slots 1-7
- this script will do the same as the first except that it will ONLY try to spam skills when a target is acquired


Ok, now let's say we don't want to just stand there and wait for a mob to get close. Let's make our character walk around and look for mobs.

Search And Destroy
Code:
u,
iscol;<color code>;<x-coordinate>;<y-coordinate>,
1,2,3,4,5,6,7,u,
endis;l,
*w,3000,-w,u,500,
iscol;<color code>;<x-coordinate>;<y-coordinate>,
1,2,3,4,5,6,7,u,
endis;l,
*s,3000,-s,u,500,
iscol;<color code>;<x-coordinate>;<y-coordinate>,
1,2,3,4,5,6,7,u,
endis;l,

EXPLANATION
- 'u' targets the closest mob that can be targeted
- 'iscol' checks to make sure there is a target by getting the UNIQUE COLOR and X-Y coordinate of the box that pops up when you target a mob
- '1,2,3,4,5,6,7,u' spams skills 1-7 and tries to target a mob to make sure you still have a target
-'*' represents a KEY DOWN event, meaning a keyboard key press
-'w' represents the key that is being pressed
-'3000', represents a delay, and when this is used AFTER a KEY DOWN event it means the key is being pressed for however long is indicated. In our case it is for 3000 milliseconds, or 3 seconds.
-'-' represents a KEY UP event, so here we are releasing the 'w' key after 3 seconds
- 'u' tries to target a mob
- '500' sets a delay of 500 milliseconds, or .5 seconds so that we can make sure we get a good lock on any mob that we have targeted.
- This script tries to target a mob, if one is targeted it spams skills until there is no target. When there is no target it presses 'W' to walk UP for 3 seconds, and again tries to target a mob. If a target is acquired it spams skills until there are no more targets then presses 'S' to walk DOWN for 3 seconds, putting the character roughly back where they started.


COLOR CODE EXPLANATION/EXAMPLE

The color code usage in the scripts seem to be a stumper for most beginners although it is VERY simple to understand.

Kab-Bot uses an integer(number) value that represents a color on your screen based on your own screen resolution. So, for example, the GREEN mob names have a color value of '68759' on my screen.

Kab-Bot uses your screen resolution to determine where on your screen a color is located. On my screen the color for a depleted HP bar is '5921279' and the coordinates for the MIDDLE of my HP bar are '195,406'. So, at coordinates 195,406 the color is 5921279 when my hp is over 50% gone.

PLEASE NOTE: Color codes are UNIQUE to each person's computer, so if you use someone else's scripts YOU MUST CHANGE THE COLORS TO MATCH THE COLOR CODES ON YOUR SCREEN OR THE SCRIPTS WILL NOT WORK.

Let's say we want to check our HP bar to see if we need to pot, and if we don't, target the next mob:

Code:
nomatch;5921279;195;406;1,u,
EXPLANATION
- 'nomatch' checks to see if the color at the specified X,Y coordinates DOES NOT MATCH
- '5921279' is the color code at X-Y coordinates 195,406 and represents the color of my HP bar when I have taken damage.
- '195' is the X coordinate position for the color code '5921279'
- '406' is the Y coordinate position for the color code '5921279'
- These X-Y coordinates represent roughly the MIDDLE POINT of my HP bar
- So, this script checks to see if the color at the MIDDLE POINT of my HP bar DOES NOT MATCH the color of a depleted HP bar. So, essentially, it checks to see if I'm at 50% HP. Simple, right?


I hope this gets some of you beginners started with the basics of the scripting syntax, how it uses your screen colors, and gives you at least a glimpse of what you can actually accomplish with Kab-Bot.

Be sure to thank kabflash for a GREAT tool!

PS. I don't have the time at the moment to make this colorful, but I hope it is easily understood. And pardon my typo in the heading...Should be "Beginner"...Hehe.
05/10/2011 22:15 Base12345#2
Make a tutorial with this color things i dont get them.
I put the colors and i get this Always an erorr your script that would have crashed the bot if ran...
05/10/2011 22:40 owndotcom#3
Quote:
Originally Posted by Base12345 View Post
Make a tutorial with this color things i dont get them.
I put the colors and i get this Always an erorr your script that would have crashed the bot if ran...
This is meant only to get people started in understanding the syntax of the scripting. There is sufficient material in the HELP from the Bot itself to explain how to change the colors, etc.
05/11/2011 00:21 kabflash#4
Quote:
Originally Posted by Base12345 View Post
Make a tutorial with this color things i dont get them.
I put the colors and i get this Always an erorr your script that would have crashed the bot if ran...
That means you have a syntax error... Like a missing ; a missing , extra comma like ',,' what have you, that error means somewhere you messed up the syntax. If you post the script I'm sure I can easily point out the error.


@owndotcom Thanks for making this tut. Don't forget tho : is used in some commands to separate certain perimeters. It's used in commands that have 2 types of perimeters, the scan command for example.
05/11/2011 09:52 tojast3#5
Nice tut but in the future u could have made a tut in creating comision scripts :)
05/11/2011 11:13 kabflash#6
Quote:
Originally Posted by tojast3 View Post
Nice tut but in the future u could have made a tut in creating comision scripts :)

Use the recorder... Record the actions it takes you to do a commission quest. ie. Walking to comm board, clicking in the right spots to sign up for the quest, going to potion shop to repot, clicking the right spots to by pots, walking to the botting area to kill the mobs for the quest, periodically opening quest window doing a color match looking for [complete], when it detects [complete] back to commision board and doing the clicks to turn it in, and start all over...

Take all that and rewrite it into a script (recorder does not output perfect script code! + you have to add the required delays)

It's best to use multiple script files for different parts of it. Like I use one file to run to board and sign up, then it uses run; command to load the next file which goes to repot, the next file ran goes to hunting spot and hunts etc.. Look at my CQ examples included with the bot.

Theres your tut...
05/11/2011 14:15 owndotcom#7
Quote:
Originally Posted by kabflash View Post
Use the recorder... Record the actions it takes you to do a commission quest. ie. Walking to comm board, clicking in the right spots to sign up for the quest, going to potion shop to repot, clicking the right spots to by pots, walking to the botting area to kill the mobs for the quest, periodically opening quest window doing a color match looking for [complete], when it detects [complete] back to commision board and doing the clicks to turn it in, and start all over...

Take all that and rewrite it into a script (recorder does not output perfect script code! + you have to add the required delays)

It's best to use multiple script files for different parts of it. Like I use one file to run to board and sign up, then it uses run; command to load the next file which goes to repot, the next file ran goes to hunting spot and hunts etc.. Look at my CQ examples included with the bot.

Theres your tut...
Your examples are superb. I built a CQ script for the Black Dragon Comm Board using them as an example.
05/11/2011 18:02 zelocos#8
Kab i try to recompile ur bot for other game... problem is there is some .frm file when i open before edit i have Error with this msg..


Line 34: Class RichTextLib.RichTextBox of control ScriptBox was not a loaded control class.
Line 92: Class MSComDlg.CommonDialog of control CommonDialog1 was not a loaded control class.
Line 100: Class RichTextLib.RichTextBox of control lscriptBox was not a loaded control class.

how to fix this so i can re compile this bot for other game... thx
05/11/2011 22:21 kabflash#9
Quote:
Originally Posted by zelocos View Post
Kab i try to recompile ur bot for other game... problem is there is some .frm file when i open before edit i have Error with this msg..


Line 34: Class RichTextLib.RichTextBox of control ScriptBox was not a loaded control class.
Line 92: Class MSComDlg.CommonDialog of control CommonDialog1 was not a loaded control class.
Line 100: Class RichTextLib.RichTextBox of control lscriptBox was not a loaded control class.

how to fix this so i can re compile this bot for other game... thx
I googled this "vb6 was not a loaded control class." and found some solutions.
05/15/2011 17:18 Spillekrogen#10
can someone help me to use bot ;p
I dont have any idea how to use it :)
I could pay irl money if u learn me how to bot..
05/16/2011 05:42 kabflash#11
Quote:
Originally Posted by zelocos View Post
Kab i try to recompile ur bot for other game... problem is there is some .frm file when i open before edit i have Error with this msg..


Line 34: Class RichTextLib.RichTextBox of control ScriptBox was not a loaded control class.
Line 92: Class MSComDlg.CommonDialog of control CommonDialog1 was not a loaded control class.
Line 100: Class RichTextLib.RichTextBox of control lscriptBox was not a loaded control class.

how to fix this so i can re compile this bot for other game... thx
I just realized you said you tried to open the .frm file... No wonder you get errors compiling your missing half the damn project (90%) actually... You need to open the .PRJ file... AKA PROJECT.
05/16/2011 15:53 owndotcom#12
Quote:
Originally Posted by Spillekrogen View Post
can someone help me to use bot ;p
I dont have any idea how to use it :)
I could pay irl money if u learn me how to bot..
Here is a basic use video TUT by TheConArtist on how to use the functions available in the bot:


If I have some time tonight I'll create and post a video TUT dedicated to creating a leveling script. However, you should be able to use the examples I posted in this thread to create your own.
05/17/2011 22:23 Base12345#13
Okay this did help but still problem at color codes. I know how to get them, I dont know what colors i need for script. Coordinate of the box that pops up when you target a mob. WHAT BOX? PLS make a Video tutorial how to add this colors ty.
05/17/2011 22:58 owndotcom#14
Quote:
Originally Posted by Base12345 View Post
Okay this did help but still problem at color codes. I know how to get them, I dont know what colors i need for script. Coordinate of the box that pops up when you target a mob. WHAT BOX? PLS make a Video tutorial how to add this colors ty.
I'll work on that. However, look at the video in my previous post. When he targets the mob a box pops up at the top of the screen with the mob's name and HP bar. That's the one I'm talking about.

So, pic a color and coordinate on that box and use that color/coordinate in your script.

Code:
iscol;<color on box>;<x coordinate on box>;<y coordinate on box>,
1,2,3,4,5,6,7,
endis,l,
05/18/2011 01:27 kabflash#15
Quote:
Originally Posted by owndotcom View Post
I'll work on that. However, look at the video in my previous post. When he targets the mob a box pops up at the top of the screen with the mob's name and HP bar. That's the one I'm talking about.

So, pic a color and coordinate on that box and use that color/coordinate in your script.

Code:
iscol;<color on box>;<x coordinate on box>;<y coordinate on box>,
1,2,3,4,5,6,7,
endis,l,
Make sure to pick a spot on the far left of the mobs hp bar... You don't want it surviving with half or a small amount of hp and then the bot switching targets.