L* R*
HOME FORUM DOWNLOADS
Content
  Links
     Browse SVN
     SVN Commit log
     Documentation (Wiki)
  Developers
     Taskmanager
User
Welcome, Guest. Please login or register.
Did you miss your activation email?
December 02, 2008, 04:12:00 PM

Login with username, password and session length
Search



Advanced search
Support GoPHP5.org
BeBot - An Anarchy Online/Age Of Conan chat automaton > Forum > Modules > 0.5.x Custom/Unofficial Modules > Topic: Tools Module
Pages: [1]   Go Down
« previous next »
Print
Author Topic: Tools Module  (Read 432 times)
0 Members and 1 Guest are viewing this topic.
Temar
BeBot Developer
Grandmaster
********
Online Online

Gender: Male
Posts: 877



WWW
Tools Module
« on: January 15, 2008, 12:21:08 AM »

This module Contains Usefull Functions to be used in Other Modules,
i have Moved a Bunch from Bot.php
also Added an Improved version of chatcmd function

If any 1 has any Ideas on Other Usefull Functions that should be Added let me know
Logged

MSN messenger: chris_smith96 at hotmain dot com
Xfire: chriss96
Glarawyn
BeBot Developer
Champion
********
Offline Offline

Posts: 414



Re: Tools Module
« Reply #1 on: January 17, 2008, 02:53:20 PM »

http://bebot.shadow-realm.org/index.php/topic,511.0.html

Heh, lib-custom.php lives.  Tongue
Logged
Glarawyn
BeBot Developer
Champion
********
Offline Offline

Posts: 414



Re: Tools Module
« Reply #2 on: January 17, 2008, 06:29:13 PM »

Here's one...
Code:
    /*
        I stole this from Helpbot, and modified it to take a targetlevel
        and a requestor level instead of a percentage.
        I also modified the return value to be just a HTML color code (#XXXXXX)
        Thanks Beaker for this handy function! http://www.kuren.org/ao/helpbot/

        This function returns the color code of the color the hp bar that a
        player of requestorlevel would see for a player of targetlevel.
        ie:
        if requestorlevel is 220 and targetlevel is 5, a grey color code would be returned.
        if requestorlevel is 220 and targetlevel is 200, a greenish color code would be returned.
        if requesterlevel is 200 and targetlevel is 220, a orangish/redish color code would be returned.
        if requestorlevel and targetlevel are equal, a yello color code is returned.
    */
    function con2rgb($targetlevel, $requestorlevel)
    { // Start function con2rgb()
        $percent = $targetlevel/$requestorlevel*100.000001;
        $G = 214.0001-(($percent-100.0001)/100.0001)*4.0001*214.0001;
        if ($G<0)
            $G=0;
        elseif ($G>214)
            $G="D6";
        else
        {
            if ($G<16)
                $G=sprintf("0%X",$G);
            else
                $G=sprintf("%X",$G);
        }

        $R = 214.00001-(100.0001-$percent)*4.0001/100.0001*214.0001;
        if ($R<0)
            $R=0;
        elseif ($R>214)
            $R="D6";
        else
        {
            if ($R<16)
                $R=sprintf("0%X",$R);
            else
                $R=sprintf("%X",$R);
        }
        if ($percent<75.0001)
            return "#909090";
        if ($percent>124.9999)
            return "#D60000";

        return "#".$R.$G."00";
    } // End function con2rgb()
Logged
Pages: [1]   Go Up
Print
BeBot - An Anarchy Online/Age Of Conan chat automaton > Forum > Modules > 0.5.x Custom/Unofficial Modules > Topic: Tools Module
« previous next »
 
Jump to:  

Recent
Log playtime from buddys ...
by IKShadow
[Today at 06:48:12 AM]

[request] Raid timers
by Elesar1
[December 01, 2008, 04:41:09 PM]

Shared DB online list
by Temar
[December 01, 2008, 01:55:47 AM]

relay colors
by Temar
[December 01, 2008, 01:54:56 AM]

BeBot v0.6.0 released
by Alreadythere
[November 30, 2008, 05:32:00 PM]

Change to Bid.php
by Temar
[November 30, 2008, 11:41:44 AM]

OnlineOrg
by Jiheld
[November 29, 2008, 12:44:27 PM]

Silly Newbie Question.
by Temar
[November 29, 2008, 12:00:02 PM]

massive_pvp_time_table 1
by gerborg
[November 29, 2008, 06:55:35 AM]

Bot not see Guild Chat
by Delvar
[November 28, 2008, 08:30:34 AM]
Stats
Members
Total Members: 1244
Latest: Armonkens
Stats
Total Posts: 11145
Total Topics: 1505
Online Today: 25
Online Ever: 168
(July 01, 2007, 09:30:02 PM)
Users Online
Users: 4
Guests: 7
Total: 11
xlDanek
clashbot
gerborg
Temar

Powered by SMF 1.1.7 | SMF © 2006-2008, Simple Machines LLC
TinyPortal v0.9.8 © Bloc | NewDef design by Bloc
Page created in 0.188 seconds with 28 queries. (Pretty URLs adds 0.024s, 4q)
Loading...