collapse collapse
* User Info
 
 
Welcome, Guest. Please login or register.
* Search

* Board Stats
  • stats Total Members: 989
  • stats Total Posts: 18366
  • stats Total Topics: 2501
  • stats Total Categories: 7
  • stats Total Boards: 35
  • stats Most Online: 1144

Author Topic: Custom modules  (Read 50532 times)

0 Members and 1 Guest are viewing this topic.

Offline craized

  • Contributor
  • *******
  • Posts: 165
  • Karma: +0/-0
    • http://www.craized.net
Custom modules
« Reply #15 on: March 11, 2005, 06:49:19 pm »
I screwed up a line and haven't had a chance to update the copy on my webserver, so heres the fixed version.


EDIT: Pulling out my posted code, module available at http://www.craized.net/junk/bebot/modules/Teams.zip
Trailin [213/14][ADVENTURER][RK2]
Bigburtha [216/17][NT][RK2][FROZEN]
Abeham [199/7][TRADER][RK2][FROZEN]


Offline craized

  • Contributor
  • *******
  • Posts: 165
  • Karma: +0/-0
    • http://www.craized.net
Custom modules
« Reply #16 on: March 28, 2005, 03:27:19 am »
I hate posting these big chunks of code over and over, but a big bug came to my attention recently. If someone leaves the bot channel, then you clear the teams, they are put into the unteamed catagory, and stay there forever. My bot ended up with 20 or so users permanently in the bot, causing a bit of confusion. This new code should fix it.

EDIT: Took out the new code because I uploaded it. Download it at
http://www.craized.net/junk/bebot/modules/Teams.zip
Trailin [213/14][ADVENTURER][RK2]
Bigburtha [216/17][NT][RK2][FROZEN]
Abeham [199/7][TRADER][RK2][FROZEN]


Offline craized

  • Contributor
  • *******
  • Posts: 165
  • Karma: +0/-0
    • http://www.craized.net
Custom modules
« Reply #17 on: April 04, 2005, 11:53:33 am »
New module!
I was tired of joining Tnet every time I wanted to check the alien playfield timer, so I made a BE Bot module for it. If your bot is set up as a guildbot as well, you can type <pre>pf in guild, a tell, or private group. I've only spent a day on this so far, so there may be a few minor timing issues. I believe its 7 hours 12 minutes between the gates opening. If anyone has a more exact figure for me, please PLEASE, e-mail me, or post here. I hope you enjoy!

Alien Playfield Module

NOTE: Timer is wrong, I have to fix it I'll post again when the time is correct. I'm having trouble finding the exact interval, I think I'll have to camp the seven hours.  :shock:
Trailin [213/14][ADVENTURER][RK2]
Bigburtha [216/17][NT][RK2][FROZEN]
Abeham [199/7][TRADER][RK2][FROZEN]


Offline craized

  • Contributor
  • *******
  • Posts: 165
  • Karma: +0/-0
    • http://www.craized.net
Custom modules
« Reply #18 on: April 05, 2005, 07:18:35 am »
AFK module!
I assume this is self explanatory, per request I finally made this.
Trailin [213/14][ADVENTURER][RK2]
Bigburtha [216/17][NT][RK2][FROZEN]
Abeham [199/7][TRADER][RK2][FROZEN]


Offline Foxferal

  • Contributor
  • *******
  • Posts: 9
  • Karma: +0/-0
Custom modules
« Reply #19 on: April 05, 2005, 09:55:35 am »
Nice indeed! Just like I wanted it, with a slight difference. (on an !online I would like to see who is afk and who is not in the given blob). A bit different way then I was planning to do it, but this looks neat, prolly neater in the end than my idea. (I would have gone the sql-route of stored values)

And a little bug:

On line 54-55: (same on line 72-73)
Code: [Select]
if(preg_match("/$key\b/i", $msg)) {
$this -> bot -> send_pgroup($key . " is AFK (" . $value . ")");


The bot reacts to its own given $key value. Result: flood.

[Mocktest] Foxferal: !afk
[Mocktest] Mocktest: Foxferal is now AFK.
[Mocktest] Mocktest: Foxferal is AFK (Away from keyboard)
[Mocktest] Mocktest: Foxferal is AFK (Away from keyboard)
[Mocktest] Mocktest: Foxferal is AFK (Away from keyboard)

Any idea on this? "Early" morning here and its about 4-5 hours before my brain starts to function... you could remove the $key value and just give a 'The user is AFK', but thats a bit boring, dont you think? ;)

Offline craized

  • Contributor
  • *******
  • Posts: 165
  • Karma: +0/-0
    • http://www.craized.net
Custom modules
« Reply #20 on: April 05, 2005, 10:22:41 am »
I don't have the flooding problem. I may have made a change that was not used in the uploaded version, try looking here or differences.
http://www.craized.net/junk/bebot/highlight?AFK

The reason I don't want to use a database for this information is because if for some reason the bot experiences a disconnect, the afk messages will be stored, thus keeping members away who should not be. On the other hand, a db would be much much easier to access  :P

I'll look at it today, but I have to wake up in a few hours.
Trailin [213/14][ADVENTURER][RK2]
Bigburtha [216/17][NT][RK2][FROZEN]
Abeham [199/7][TRADER][RK2][FROZEN]


Offline craized

  • Contributor
  • *******
  • Posts: 165
  • Karma: +0/-0
    • http://www.craized.net
Custom modules
« Reply #21 on: April 05, 2005, 10:43:36 am »
Turn out to be a quick thing
Code: [Select]
if($name != "Dosraids") {
change this to
Code: [Select]
if($name != $this -> bot -> botname) {
and add it into the gc function as well. I used my bot's name on accident for testing purposes and forgot to change it. This will make sure that the afk message isn't echoed when the bot says a players name.

This link has the updated code, I'll upload the new zip file as soon as I get a chance.

http://www.craized.net/junk/bebot/highlight?AFK

Thank you for the bug report  :D
Trailin [213/14][ADVENTURER][RK2]
Bigburtha [216/17][NT][RK2][FROZEN]
Abeham [199/7][TRADER][RK2][FROZEN]


Offline Foxferal

  • Contributor
  • *******
  • Posts: 9
  • Karma: +0/-0
Custom modules
« Reply #22 on: April 06, 2005, 12:09:47 am »
!afk works like a charm now, thanks :)

well... only one little detail.... ;)

To show in the list if listed users are afk, on an !online... that would pull the plugin into perfection... :D

Offline craized

  • Contributor
  • *******
  • Posts: 165
  • Karma: +0/-0
    • http://www.craized.net
Custom modules
« Reply #23 on: April 06, 2005, 06:45:24 am »
Hate making these huge posts, but here's the new Online.php in the core folder of your bot.

EDIT: Modded Online.php code added to my AFK modules zip package at
http://www.craized.net/junk/bebot/modules/AFK.zip

Change this, if theres any bugs, please let me know.
Trailin [213/14][ADVENTURER][RK2]
Bigburtha [216/17][NT][RK2][FROZEN]
Abeham [199/7][TRADER][RK2][FROZEN]


Offline Lal

  • BeBot User
  • **
  • Posts: 53
  • Karma: +0/-0
Custom modules
« Reply #24 on: April 06, 2005, 09:21:27 pm »
WTB AI lvl also o.O
[205/12][Lalsoldier][RK2]

[190/5][Laldoc][RK2]

[195/10][Lalnt][RK2]

Offline Lal

  • BeBot User
  • **
  • Posts: 53
  • Karma: +0/-0
Custom modules
« Reply #25 on: April 06, 2005, 09:32:00 pm »
Warning: Division by zero in C:\BeBot\modules\AFK.php on line 64

when using !afk, doesnt do anything




and its showing this:

 in !online:

Soldier
 - Lvl 200 Lalsoldier (Squad Commander) :: 768689656's Alts ::


commpre . "afk(.)*"/i, $msg
changed to
commpre . "afk(.)*/i", $msg


[Virtual Insanity] Lalsoldier: !afk
[Virtual Insanity] Vibot: Lalsoldieris now AFK.



ok, well still a missing space and showing id as alts.. :S
200 Lalsoldier (Squad Commander) :: 768689656's Alts ::(
[205/12][Lalsoldier][RK2]

[190/5][Laldoc][RK2]

[195/10][Lalnt][RK2]

Offline Lal

  • BeBot User
  • **
  • Posts: 53
  • Karma: +0/-0
Custom modules
« Reply #26 on: April 06, 2005, 09:37:07 pm »
Quote from: "craized"
New module!
I was tired of joining Tnet every time I wanted to check the alien playfield timer, so I made a BE Bot module for it. If your bot is set up as a guildbot as well, you can type <pre>pf in guild, a tell, or private group. I've only spent a day on this so far, so there may be a few minor timing issues. I believe its 7 hours 12 minutes between the gates opening. If anyone has a more exact figure for me, please PLEASE, e-mail me, or post here. I hope you enjoy!

Alien Playfield Module

NOTE: Timer is wrong, I have to fix it I'll post again when the time is correct. I'm having trouble finding the exact interval, I think I'll have to camp the seven hours.  :shock:


7hours 20mins If I remember right
[205/12][Lalsoldier][RK2]

[190/5][Laldoc][RK2]

[195/10][Lalnt][RK2]

Offline Lal

  • BeBot User
  • **
  • Posts: 53
  • Karma: +0/-0
Custom modules
« Reply #27 on: April 06, 2005, 10:33:31 pm »
oh well, your afk then... how to un-afk?

!afk doesnt work..


                    if(preg_match("#$key\b#i", $msg)) {
                        $this -> bot -> send_pgroup($key . " is AFK (" . $value . ")");


IS different then


                    if(preg_match("/$key\b/i", $msg)) {
                        $this -> bot -> send_gc($key . " is AFK \(" . $value . "\)");  

huh???
[205/12][Lalsoldier][RK2]

[190/5][Laldoc][RK2]

[195/10][Lalnt][RK2]

Offline craized

  • Contributor
  • *******
  • Posts: 165
  • Karma: +0/-0
    • http://www.craized.net
Custom modules
« Reply #28 on: April 07, 2005, 01:36:32 am »
Thank you for the 7 hours 20 minutes, I'll check it out. To un-afk, simply say anything in chat. I haven't set up any alt records for myself, so I wasn't aware of that bug. I'll look into it. Also, this is only a raid bot for me, so I didn't get a chance to test the guild chat section, I'll make that fix as well.
Trailin [213/14][ADVENTURER][RK2]
Bigburtha [216/17][NT][RK2][FROZEN]
Abeham [199/7][TRADER][RK2][FROZEN]


Offline craized

  • Contributor
  • *******
  • Posts: 165
  • Karma: +0/-0
    • http://www.craized.net
Custom modules
« Reply #29 on: April 07, 2005, 01:45:35 am »
After testing and looking through my code, I've made a few minor changes, but I haven't had any trouble with my alts records. I changed the guild afk notice so that it no longer has \ in front of the () and moved the " in the expression match, but could not find any other problems. Thank you very much for your help, I'll upload my changes in about 5 minutes.
Trailin [213/14][ADVENTURER][RK2]
Bigburtha [216/17][NT][RK2][FROZEN]
Abeham [199/7][TRADER][RK2][FROZEN]


 

* Recent Posts
Com bot module by bitnykk
[November 25, 2024, 05:36:11 pm ]


0.8.x updates for AO by bitnykk
[June 23, 2024, 03:19:47 pm ]


0.8.x updates for AoC by bitnykk
[June 23, 2024, 03:19:44 pm ]


[AoC] special char for items module by bitnykk
[February 09, 2024, 09:41:18 pm ]


BeBot still alive & kicking ! by bitnykk
[December 17, 2023, 12:58:44 am ]

* Who's Online
  • Dot Guests: 374
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.
* Forum Staff
bitnykk admin bitnykk
Administrator
Khalem admin Khalem
Administrator
WeZoN gmod WeZoN
Global Moderator
SimplePortal 2.3.7 © 2008-2024, SimplePortal