pGrind

10/12/2011 09:37 dumbfck#256
Looking forward to seeing how that turns out hehe. Do you mean for some sort of "I'm not really a bot" auto-reply? If so, I'd be very interested to see what sort of AI back-end you use for that ^_^
10/12/2011 09:44 Sᴡoosh#257
I will use a looped FSN approach, depending on certain keywords in chat message. Bot loops through message, an categorizes words into groups. The group which has the most members at end will trigger an action.

I have this actually already written from another project, will just need some fine tuning.

For example :

"Can I haz gold pls?"

5 words
0 - Can -> group begging
1 - I -> group begging
2 - Soundex algorithm says simular to another word in list, "has" -> general question
3 - Gold -> likely to be begging too
4 - pls -> def. begging

Hence logic declares this as unimportant and thus answers with generalized answer.

This is some chat code I had written already :

Code:
//duke?
          if AnsiContainsStr(tempchatmsg, '^FF3600<3><9><0><1.000000><>') = true then
          begin
            Tempchatmsg := stringreplace(tempchatmsg, '^FF3600<3><9><0><1.000000><>', '[Annoying Duke] : ', [rfReplaceAll, rfIgnoreCase]);
            Tempchatmsg := stringreplace(tempchatmsg, '&', ' ', [rfReplaceAll, rfIgnoreCase]);
          end;
//Guild?
          if AnsiContainsStr(tempchatmsg, '^00FFFC<3><3><0><1.000000><>') = true then
          begin
            Tempchatmsg := stringreplace(tempchatmsg, '^00FFFC<3><3><0><1.000000><>', '[Guild] : ', [rfReplaceAll, rfIgnoreCase]);
            Tempchatmsg := stringreplace(tempchatmsg, '&', ' ', [rfReplaceAll, rfIgnoreCase]);
          end;
//pm?
          if AnsiContainsStr(tempchatmsg, '^0065FE<3><4><0><1.000000><>') = true then
          begin
            Tempchatmsg := stringreplace(tempchatmsg, '^0065FE<3><4><0><1.000000><>', '[Private] : ', [rfReplaceAll, rfIgnoreCase]);
            Tempchatmsg := stringreplace(tempchatmsg, '&', ' ', [rfReplaceAll, rfIgnoreCase]);
            msg2read := stringreplace(tempchatmsg, '[Private] : ', '', [rfReplaceAll, rfIgnoreCase]);
//WC?
          if AnsiContainsStr(tempchatmsg, '^FFE400<3><1><0><1.000000><>') = true then
          begin
            Tempchatmsg := stringreplace(tempchatmsg, '^FFE400<3><1><0><1.000000><>', '[World] : ', [rfReplaceAll, rfIgnoreCase]);
            Tempchatmsg := stringreplace(tempchatmsg, '&', ' ', [rfReplaceAll, rfIgnoreCase]);
          end;
//common?
          if AnsiContainsStr(tempchatmsg, '^FFFFFF<3><0><0><1.000000><>') = true then
          begin
            Tempchatmsg := stringreplace(tempchatmsg, '^FFFFFF<3><0><0><1.000000><>', '[Common] : ', [rfReplaceAll, rfIgnoreCase]);
            Tempchatmsg := stringreplace(tempchatmsg, '&', ' ', [rfReplaceAll, rfIgnoreCase]);
          end;
//squad?
          if AnsiContainsStr(tempchatmsg, '^00FF00<3><2><0><1.000000><>') = true then
          begin
            Tempchatmsg := stringreplace(tempchatmsg, '^00FF00<3><2><0><1.000000><>', '[Squad] : ', [rfReplaceAll, rfIgnoreCase]);
            Tempchatmsg := stringreplace(tempchatmsg, '&', ' ', [rfReplaceAll, rfIgnoreCase]);
          end;
//system?
          if AnsiContainsStr(tempchatmsg, '^BED293') = true then
          begin
            Tempchatmsg := stringreplace(tempchatmsg, '^BED293', '[System] : ', [rfReplaceAll, rfIgnoreCase]);
            Tempchatmsg := stringreplace(tempchatmsg, '&', ' ', [rfReplaceAll, rfIgnoreCase]);
          end;

//trade
          if AnsiContainsStr(tempchatmsg, '^FF742E<3><7><0><1.000000><>') = true then
          begin
            Tempchatmsg := stringreplace(tempchatmsg, '^FF742E<3><7><0><1.000000><>', '[Trade] : ', [rfReplaceAll, rfIgnoreCase]);
            Tempchatmsg := stringreplace(tempchatmsg, '&', ' ', [rfReplaceAll, rfIgnoreCase]);
          end;


//sz?
          if AnsiContainsStr(tempchatmsg, '^00ff00') = true then
          begin
            Tempchatmsg := stringreplace(tempchatmsg, '^00ff00', '[System] : ', [rfReplaceAll, rfIgnoreCase]);
            Tempchatmsg := stringreplace(tempchatmsg, '&', ' ', [rfReplaceAll, rfIgnoreCase]);
          end;


//out sz?
          if AnsiContainsStr(tempchatmsg, '^ff0000') = true then
          begin
            Tempchatmsg := stringreplace(tempchatmsg, '^ff0000', '[System] : ', [rfReplaceAll, rfIgnoreCase]);
            Tempchatmsg := stringreplace(tempchatmsg, '&', ' ', [rfReplaceAll, rfIgnoreCase]);
          end;

//Snowman?
          if AnsiContainsStr(tempchatmsg, '^C8FF64<3><0><0><1.000000><>') = true then
          begin
            Tempchatmsg := stringreplace(tempchatmsg, '^C8FF64<3><0><0><1.000000><>', '', [rfReplaceAll, rfIgnoreCase]);
            Tempchatmsg := stringreplace(tempchatmsg, '&', ' ', [rfReplaceAll, rfIgnoreCase]);
          end;


           Tempchatmsg := stringreplace(tempchatmsg, '<1><>', '[Item] ', [rfReplaceAll, rfIgnoreCase]);
Cheers
10/12/2011 10:01 ptdk#258
for some reason the bot doesnt choose the closest possible minion(or it might just thinks that those arent fine for some reason - yet they have their name selected) - and this fks up botting on ground pretty well. (due to that at lvl1 minions it gets stuck all the time in objects, while there u couldnt run out of spawn just by standing in the very same place)

also when picking up loot from further places, the bot doesnt pick up the closest ones, but in some sort of priority order, which makes it run back and forth for some while.
10/12/2011 10:04 Sᴡoosh#259
ptdk,

Yeah, your right, the targeting needs some fine tuning, sometimes comparrison variable is not cleared, hence making targeting code target the most far away (!) mob tehre is :D

I noticed this yesterday, ill see to fix it in next update.

The drops should actually be sorted by quicksort algorithm, same as the materials it farms. Are you certain this happens? Cause I would not currently know why, it works fine for me :)
10/12/2011 10:14 dumbfck#260
Quote:
Originally Posted by Sᴡoosh View Post
I will use a looped FSN approach, depending on certain keywords in chat message. Bot loops through message, an categorizes words into groups. The group which has the most members at end will trigger an action...
That sounds really cool. Can't wait to test it out :D
Btw, for checking what type of message you've received, it might be a bit more efficient to check the message type from [chatObj]+0x04] rather than parsing the received string every time. I know it wouldn't make that much difference, but once you have half a dozen bots running it would soon add up, especially considering how much stuff is going on every time your timer ticks :P. You'd only need to check the message scope of any new messages each time one appears - I.e., read a dword into a switch vs read / decode / strcomp / strreplace every message.
I know it's prolly less than microseconds, but hey... I program microcontrollers so every instruction is precious lol.
Cheers.
10/12/2011 10:16 Sᴡoosh#261
Oh, yes, thanks :)

That is indeed a much more efficient method - wrote that crapcode long before you published your nice tutourial though :)

Ill change it a bit.

Thanks for this^^
10/12/2011 10:19 ptdk#262
Quote:
Originally Posted by Sᴡoosh View Post
ptdk,

Yeah, your right, the targeting needs some fine tuning, sometimes comparrison variable is not cleared, hence making targeting code target the most far away (!) mob tehre is :D

I noticed this yesterday, ill see to fix it in next update.

The drops should actually be sorted by quicksort algorithm, same as the materials it farms. Are you certain this happens? Cause I would not currently know why, it works fine for me :)
saw this happen yesterday nnight with the drops, if it keeps happening i will let u know.

also i am not quite sure if the problem is on my end as my computer is shitty, but its the third time i get this server error thing with the new bot, which never really happened before, or like 1-2 times in all of my PW career(which pretty long)

[Only registered and activated users can see links. Click Here To Register...]

Uploaded with [Only registered and activated users can see links. Click Here To Register...]

e: as i was uploading the ss something must have happened as its running again without a relog lol
10/12/2011 10:22 Sᴡoosh#263
I'll check it out, thanks for the help.

Could ya do me a favor and pass me your profile file you where using at that time?
There is nothing personalized in there, its only named like your character by default. Please rename it and let me see it, will help me see what exactly you did and what config you where running.

Cheers
10/12/2011 10:56 ptdk#264
there u go

[Only registered and activated users can see links. Click Here To Register...]
10/12/2011 12:22 Sᴡoosh#265
I just rewrote targeting, optimized it quite a bit. Next release should go without any more strange targeting acts.

By the way, there are no settings set in that profile at all. Just an empty shell. You sure you sent me the correct one? Save in bot, then check. If you upen it in a hex editor, you shouldn't have only 00 :)

Cheers
10/12/2011 13:08 ptdk#266
sry, didnt save it.

i opened it with notepad, and was wondering how does that work just a few of those square characters, but as i didnt set too much things i was like it should be OK.

here is the new link:
[Only registered and activated users can see links. Click Here To Register...]
10/12/2011 13:09 Sᴡoosh#267
Thanks.

Its saved in binary dump, not text format. You can view it with a hex editor.

To those of you interested in writing their own little helper scripts, you will love beta 4 engine.

Here are some scripts which will work on beta 4 (NOT ON BETA 3.1!!) :


Sells complete inventory to selected merchant, except your pickaxe. Makes use of Inventory handling functions.

Code:
{ pGrind Script file , created @ 3:57:39 PM   10/12/2011}
{BE EXTREMELY CAREFUL WITH THIS SCRIPT!}
program Sell_Whole_Inventory;
var
  i: integer; //counter variable
  ID, Number: Integer; //Inventory data
begin
//So, lets sell our inventory.
//Loop through it...
  for i := 0 to GetInventorySize - 1 do
  begin
 
//First, lets get the info we need for Selling :)
    ID := GetIDFromSlot(i); //Get ID from item of current slot
   
    Number := GetNumFromSlot(i); //Get number of items on that stack
//Lets not sell Pickaxe (ID 3073) though!
 
 if (ID <> 0) and (ID <> 3073) then
    begin
      SellItem(ID, i, Number); //If item exists in slot, sell it!
      Sleep(500); //Give it time :)
    end;
   
  end;
end.

Introducing the most powerful function of all : SendPacket(). You can tell pGrind to send your own packets to server, and pGrind will take care of sending.

Code:
{ pGrind Script file , created @ 9:50:43 PM   10/11/2011}
{Make sure you have 5 inventory slots free.}
Program Combine_CS_Rough;
Begin
If gettarget <> 0 then
    begin

//Letz combine 3 shabby Alabaster shards to 1 rough!
//this is the packet which does it.
SendPacket('25000C0000000C000000000000009F02000001000000');
//wait some time, so it can combine
Sleep(2000);
//Now we repeat this for the rest of the stones.
SendPacket('25000C0000000C00000000000000A602000001000000');
Sleep(2000);
SendPacket('25000C0000000C00000000000000AD02000001000000');
Sleep(2000);
SendPacket('25000C0000000C00000000000000B402000001000000');
Sleep(2000);
SendPacket('25000C0000000C00000000000000BB02000001000000');
Sleep(2000);
//done, we combined them all.
//You now have 5 roughs in inventory :)
    end;
End.
Use items in inventory by name

Code:
{ pGrind Script file , created @ 9:10:03 PM   9/29/2011}
Program UseInventoryItem;
Begin
UseItem_Name('Sesame Oil');
Sleep(500);
UseItem_name('Small Mana Potion'); //captitalisation is unimportant
End.

And some other fun commands. Keep tuned :)
10/12/2011 23:09 TurboGolom#268
pls pls pls try to release the supporter function in the next beta stage xDDDDDDDDDDDDD
10/12/2011 23:11 Sᴡoosh#269
Squad support will not be in beta 4 - Pot buying and chat is planned here.

Squad support will come in beta 5 or final.
10/13/2011 03:00 3aber sabil#270
IS it already stopped for free or what ,, start is not working with me atm