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

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

Author Topic: Problem with Orders Module  (Read 2325 times)

0 Members and 1 Guest are viewing this topic.

Offline Glarawyn

  • BeBot Hero
  • ******
  • Posts: 521
  • Karma: +0/-0
Problem with Orders Module
« on: April 25, 2006, 08:01:28 pm »
Code on Pastebin

Module Usage:
Set orders:
/tell bot !orders blah blah blah
/g bot !orders blah blah blah

Clear orders:
/tell bot !orders
/g bot !orders

When orders are set, a cron job is setup. When orders are cleared, the cron job is unset. I'm still fuzzy on how exactly this works, I just borrowed the method from RaidTime.php and crossed my fingers, and it worked. :)

There are three ways to clear orders: via tell, via pgroup, and cron.

Tell, pgroup, and cron all call the same clear_orders function when orders are cleared.

The problem:

Orders are cleared and do not get sent out when a user joins the private group when orders are cleared with a tell or via pgroup, but when orders are cleared via cron users still get an orders tell when joining the bot.

Offline Alreadythere

  • BeBot Maintainer
  • BeBot Hero
  • ******
  • Posts: 1288
  • Karma: +0/-0
Re: Problem with Orders Module
« Reply #1 on: April 25, 2006, 08:45:21 pm »
Looking over your code, it looks ok.

Only thing - why are you using is_null and not isset? You are using unset after all.

Offline Glarawyn

  • BeBot Hero
  • ******
  • Posts: 521
  • Karma: +0/-0
Re: Problem with Orders Module
« Reply #2 on: April 25, 2006, 10:35:42 pm »
Pastebin is out of date now. Current code is isset(), but it gives me the same strange behavior.

MatHack

  • Guest
Re: Problem with Orders Module
« Reply #3 on: April 26, 2006, 10:34:33 am »
Looks ok yeah, did you check if the orders are really empty after calling the clear_orders where it causes problems?

Offline Glarawyn

  • BeBot Hero
  • ******
  • Posts: 521
  • Karma: +0/-0
Re: Problem with Orders Module
« Reply #4 on: April 26, 2006, 10:17:43 pm »
Looks ok yeah, did you check if the orders are really empty after calling the clear_orders where it causes problems?

Yup, it was all very funky. I solved it by dropping the idea I got from RaidTime.php and just checking to see if the order set time was greater than 1. It might waste a few more CPU cycles that nobody is going to notice being wasted anyway, but it works reliably. ;)

 

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


0.8.x updates for AoC by bitnykk
[January 30, 2024, 11:16:08 pm]


0.8.x updates for AO by bitnykk
[January 30, 2024, 11:15:37 pm]


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


Bebot and Rasberry by bitnykk
[November 29, 2023, 11:04:14 pm]

* Who's Online
  • Dot Guests: 731
  • 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