@Wongfei :
I will consider pet skills.
What do you mean with targeting like mhs/oracle?
I probably will not implement DC stuff.
-----------------------------------------
For all people who may be interested in scripting the bot, I wrote a small tutourial which hopefully outlines all you need to get started a bit. I will strongly improve the scripting next release, and also add definitions.
Anyways, heres my tuturial. It can also be found on my site ,

.
Lets go
Hey guys,
alright this is for all of you who wish to write their own bot
on pGrind you will find a tab called scripting. It looks pretty bad now, and very unattractive to the eye. I will implement syntax highlighting and other helpfull stuff the next few updates.
Anyways, lets continue.
You have 3 main boxes on this tab, and a few buttons. The box titled "Code" is where your code goes. The box named Output is the log of the interpreter. And finally, the "Installed Scripts" one lists all saved scripts.
pGrind uses a delphi/Pascal dialect for scripting. Hence , the main program flow always looks like this :
Code:
Program pGrind_Demo;
Begin
End.
For this example, ive decided to name the program pGrind_Demo. It does not matter what you choose, but I suggest keeping it the same as the filename. The name may
NOT include spaces or special characters, or a number as first character.
Good :
Bad : - 2lol
- test program
- killer$33
- "grind"r
Alright, lets continue.
Now that we know how a program is built, we can get to the basics. You can use functions and procedure, variables and directives, constants and structs.
Consider the small example program I included in pGrind :
Code:
Program Rest; //Program name
Begin //begin declaration
Rest; //procedure "rest"
End. //end of program
This simply makes your character sit down. "Rest" is a procedure, means that it does not give a return value. Functions pass return values.
Now lets look at said functions.
Code:
Program getinfo;
Begin
writeln(inttostr(gethp));
End.
If you run this, you will get the following output :
Quote:
Syntax check...
Syntax checked successfully 
1234 //YOUR HP will be different ofc 
Succesfully executed
|
Lets analyse this.
writeln()
This function writes a STRING to the output window.
IntToStr()
This function typecasts an integer value into a string.
GetHP()
This function retrives the character HP for you.
So basically, the command hirarchy is like this :
GetHP -> returns integer (your hp) -> inttostr() -> converts to string -> writeln() writes this line to output.
Clear so far? If yes, you have pretty much understood the basics
Now to more fun stuff. You will stumble over cases where you must use conditionals.
Code:
Program OneKill; //Creative name, huh?
Begin //Begin of program
SelectClosestMob; //Select the closest mob
If gettarget <> 0 //Was it successfull?
then
Killmonster; //Kill it with fire!!11
If Gethp < getmaxhp //Do we need to rest?
then
rest; //Yepp, lets chill a bit
end. //End of program
Maybe you recognise this - its the script I wrote already for you guys, it comes with pGrind.
Read the comments I wrote, it should pretty much clarify all.
Quick walkthrough of conditionals :
If [CONDITION]
then [DOSHIT];
Pretty much self explinatory
Also, some comparisson operators :
<> - not equal
0 <> 1 = true
0 <> 0 = false
= - equal
0 = 1 = false
0 = 0 = true
< - smaller then
0 < 1 = true
0 < 0 = false
1 < 0 = false
> - smaller then
0 > 1 = false
0 > 0 = false
1 > 0 = true
All comparrison operators can be used with "=" too. For example : <= means "smaller or equal". Its the same as writing
(0 < 1) OR (0 = 1). Which brings us to our enxt point :
Logical operators.
OR
If [CONDITION_one]
OR [CONDITION_two] then DOSHIT;
AND
see above, it should also be self - explinatory
Now for some more fun.
We need a way to do something for a certain amount of time, or until a certain condition is true or false. Welcome to the world of loops.
For this, we need to declare a counter variable. This is just a place where the interpreter will place the loop index.
Declare a variable like this :
Code:
Program Loopdemo;
Var
Counter : Integer;
Begin
//empty for now
end;
This will make our variable "Counter" accessable for our program.
Now to the loop :
Code:
Program Loopdemo;
Var
Counter : Integer;
Begin
For Counter := 0 to 3 do
writeln('Hello world!!!11!!');
end.
This will generate the following output :
Quote:
Syntax check...
Syntax checked successfully 
Hello world!!!11!!
Hello world!!!11!!
Hello world!!!11!!
Hello world!!!11!!
Succesfully executed
|
Bingo
Do not wonder why the line is outputted 4 times - the script is 0 indexed, means it starts at 0 and works up to the given delimiter.
0 - 1 - 2 - 3 = 4 lines
Alright, I hope this will help those who are interested in writing scripts. Check out beta 3 - it will offer much more powerful commands and an improved execution model.
Cheers