Archive > AO official modules

Tokens Calulator

(1/4) > >>

nebhyper:
Tokens Calculator Module

Basically you tell it your level, goal tokens, current tokens and it tells you the number of bags and token (discs) you need to reach that goal.

!tokens 205 2500 1319



CHANGE
4 Feb 2007
- Fixed so you can not enter 0 for goal.
- Fixed tell responses to not send blobs.

3 Feb 2007
- !tokens no longer needs your level.  The code finds your level.  You can still eneter your level just in case your character info has not been added to the members table or the whois cache table.
- Changed the output to be a link displaying your stats on the top and the bottom has what you need to achieve your goal.
- Included upcoming Tokens for VP.


EDIT: Added Change log and files to first post

jjones666:
Excellent plugin, moved to the official custom modules section.

-jj-

Malosar:

--- Code: ---    function tell($name, $msg)
    {
      if (preg_match("/^".$this -> bot -> commpre."tokens ([0-9]+) ([0-9]+) ([0-9]+)$/i", $msg, $info)) {
         $this -> bot -> send_tell($this -> ShowTokens($info[1], $info[2], $info[3]));
      }
    }
--- End code ---

send_tell needs a $name, change to:


--- Code: ---$this -> bot -> send_tell($name,$this -> ShowTokens($info[1], $info[2], $info[3]));
--- End code ---

nebhyper:
Actually I forgot to update this post. 

I've attached my current module.


EDIT: Changed first post to have changes and files

nebhyper:
Changed the posts around to be more clear.

Changes and files added to first post.

Help file and php file have been changed and added to first post.

Navigation

[0] Message Index

[#] Next page

Go to full version