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 01, 2008, 11:09:40 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.4.x Custom/Unofficial Modules > Topic: Modified TowerAttack.php
Pages: [1]   Go Down
« previous next »
Print
Author Topic: Modified TowerAttack.php  (Read 482 times)
0 Members and 1 Guest are viewing this topic.
Hyde
Rookie
**
Offline Offline

Posts: 46


Modified TowerAttack.php
« on: August 25, 2007, 02:27:39 PM »

Modification to add faction colors to the display. Hopefully this can get slurped into the SVN so here's a diff to patch this against 0.4.1's TowerAttack (download original version to patch) ...

`diff _TowerAttack.php-revision912 TowerAttack.php`

Code:
146a147,151
>       /* Called to colorize faction string */
>         function factioncolor($side) {
>                 $side = "##" . strtolower($side) . "##" . $side . "##end##";
>                 return($side);
>         }
159,160c164,165
<                       $battle .= "Winner: <font color=CCCCTextColor>" . stripslashes($res[1]) . "</font> <font color=CCCCHeaderColor>(" . $res[2] . ")</font>\n";
<                       $battle .= "Looser: <font color=CCCCTextColor>" . stripslashes($res[3]) . "</font>  <font color=CCCCHeaderColor>(" . $res[4] . ")</font>\n";
---
>                       $battle .= "Winner: <font color=CCCCTextColor>" . stripslashes($res[1]) . "</font> <font color=CCCCHeaderColor>(" . $this -> factioncolor($res[2]) . ")</font>\n";
>                       $battle .= "Looser: <font color=CCCCTextColor>" . stripslashes($res[3]) . "</font>  <font color=CCCCHeaderColor>(" . $this -> factioncolor($res[4]) . ")</font>\n";
183,184c188,189
<                       $battle .= "Attacking Guild: <font color=CCCCTextColor>" . stripslashes($res[1]) . "</font>  <font color=CCCCHeaderColor>(" . $res[2] . ")</font>\n";
<                       $battle .= "Defending Guild: <font color=CCCCTextColor>" . stripslashes($res[6]) . "</font>  <font color=CCCCHeaderColor>(" . $res[7] . ")</font>\n";
---
>                       $battle .= "Attacking Guild: <font color=CCCCTextColor>" . stripslashes($res[1]) . "</font>  <font color=CCCCHeaderColor>(" . $this -> factioncolor($res[2]) . ")</font>\n";
>                       $battle .= "Defending Guild: <font color=CCCCTextColor>" . stripslashes($res[6]) . "</font>  <font color=CCCCHeaderColor>(" . $this -> factioncolor($res[7]) . ")</font>\n";
244,245c249,250
<                       $msg = "<font color=#ffff00>" . $off_guild . "</font> <font color=#dddddd>(" . $off_side . ")</font> has attacked <font color=#ffff00>" .
<                       $def_guild . "</font> <font color=#dddddd>(" . $def_side . ")</font> in " . $zone . " at " . $x_coords . "x" . $y_coords. ". Attacker: <font color=#ffff00>" .
---
>                       $msg = "<font color=#ffff00>" . $off_guild . "</font> <font color=#dddddd>(</font>" . $this -> factioncolor($off_side) . "<font color=#dddddd>)</font> has attacked <font color=#ffff00>" .
>                       $def_guild . "</font> <font color=#dddddd>(</font>" . $this -> factioncolor($def_side) . "<font color=#dddddd>)</font> in " . $zone . " at " . $x_coords . "x" . $y_coords. ". Attacker: <font color=#ffff00>" .
249c254
<                       $def_guild . "</font> <font color=#dddddd>(" . $def_side . ")</font> in " . $zone . " at " . $x_coords . "x" . $y_coords. ".";
---
>                       $def_guild . "</font> <font color=#dddddd>(</font>" . $this -> factioncolor($def_side) . "<font color=#dddddd>)</font> in " . $zone . " at " . $x_coords . "x" . $y_coords. ".";
« Last Edit: August 25, 2007, 02:29:32 PM by Hyde » Logged

Doctorhyde/Jexyll/Goraud@RK2
Blueeagle
Omnipotent
BeBot Developer
Expert
********
Offline Offline

Gender: Male
Posts: 313



Re: Modified TowerAttack.php
« Reply #1 on: August 25, 2007, 07:39:01 PM »

The "new and improved"(tm) way of doing this is ##clan##organisationname##end##

For further reference read http://bebot.shadow-realm.org/wiki/colors
Logged

The only problem that can't be solved by adding another wrapper is having too many wrappers.
Hyde
Rookie
**
Offline Offline

Posts: 46


Re: Modified TowerAttack.php
« Reply #2 on: August 27, 2007, 12:02:03 AM »

Quote from: Blueeagle on August 25, 2007, 07:39:01 PM
The "new and improved"(tm) way of doing this is ##clan##organisationname##end##

For further reference read http://bebot.shadow-realm.org/wiki/colors

Actually, if you look at what I did, that's exactly what I did. I just called a function to lowercase the side name.

I think the confusion lies in where I said "called to colorize", bad terminology mishmash Smiley
Logged

Doctorhyde/Jexyll/Goraud@RK2
Blueeagle
Omnipotent
BeBot Developer
Expert
********
Offline Offline

Gender: Male
Posts: 313



Re: Modified TowerAttack.php
« Reply #3 on: August 27, 2007, 12:54:56 AM »

My bad. I was looking at the old code. Smiley
Logged

The only problem that can't be solved by adding another wrapper is having too many wrappers.
Dabaron
Apprentice
***
Offline Offline

Gender: Male
Posts: 145


Re: Modified TowerAttack.php
« Reply #4 on: September 12, 2007, 12:17:50 AM »

Maybe I'm just being dumb here... but what did you use to extract (and now to put it into the file)?

I assumed you used diff to extract it and would need patch to insert it into the file with what you pasted but when I attempt that I get:

(Stripping trailing CRs from patch.)
Hunk #2 FAILED at 164.
Hunk #3 FAILED at 188.
Hunk #4 FAILED at 249.
patch unexpectedly ends in middle of line
patch: **** unexpected end of file in patch at line 27


Any help would be appreciated
Logged
Slacklin
Rookie
**
Offline Offline

Posts: 30


Re: Modified TowerAttack.php
« Reply #5 on: September 12, 2007, 12:52:28 AM »

If any of you had difficulties getting the code to insert properly, here is a fully edited version for you to download. Just extract and copy over the old file. (Be sure to backup the original just in case)

http://www.tainteddonuts.com/aogoodies/TowerAttack.zip

Enjoy!
« Last Edit: September 12, 2007, 12:57:17 AM by jakethegamer » Logged
Dabaron
Apprentice
***
Offline Offline

Gender: Male
Posts: 145


Re: Modified TowerAttack.php
« Reply #6 on: September 12, 2007, 01:47:14 AM »

Ok, that worked but I guess I should have read what was being changed a bit closer because it didn't do what I thought it was going to.  This only changes the battle blob, not the attack messages themselves.  Guess I'll write it up for that part (so it looks like the one in the .2.x release I had) and post when I get around to doing it.
Logged
Nogoal
Rookie
**
Offline Offline

Posts: 61


Re: Modified TowerAttack.php
« Reply #7 on: September 17, 2007, 10:17:26 AM »

http://bebot.shadow-realm.org/index.php/topic,963.0.html Tongue Also gives LCA numbers!
Logged
Pages: [1]   Go Up
Print
BeBot - An Anarchy Online/Age Of Conan chat automaton > Forum > Modules > 0.4.x Custom/Unofficial Modules > Topic: Modified TowerAttack.php
« previous next »
 
Jump to:  

Recent
[request] Raid timers
by Elesar1
[Today at 04:41:09 PM]

Shared DB online list
by Temar
[Today at 01:55:47 AM]

relay colors
by Temar
[Today at 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]

Starting Bot
by Allisande
[November 28, 2008, 07:08:21 AM]
Stats
Members
Total Members: 1243
Latest: Whackoeng
Stats
Total Posts: 11144
Total Topics: 1505
Online Today: 21
Online Ever: 168
(July 01, 2007, 09:30:02 PM)
Users Online
Users: 1
Guests: 15
Total: 16
clashbot

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.783 seconds with 28 queries. (Pretty URLs adds 0.029s, 4q)
Loading...