Castle Control Script

Have you created a useful tool? or Do you want to get help building one? This is the right place!
Forum rules
READ NOW: L2j Forums Rules of Conduct
User avatar
janiii
L2j Veteran
L2j Veteran
Posts: 4269
Joined: Wed May 28, 2008 3:15 pm
Location: Slovakia

Re: Castle Control Script

Post by janiii » Sat Jan 30, 2010 8:15 am

disorder35 wrote:Also on IE it have scrolling on the right side and on the bottom of each castle box. How do we get the scrolling off?
in index.php delete "overflow: auto;"
DO NOT EVEN TRY TO MESS WITH ME!
forum flOOder dancing dEVILoper
I don't give private support - PM will be ignored!

User avatar
disorder35
Posts: 700
Joined: Sat Aug 01, 2009 3:29 pm

Re: Castle Control Script

Post by disorder35 » Sat Jan 30, 2010 4:11 pm

That did it thanks.
So What?????

User avatar
kocinski
Posts: 141
Joined: Wed May 06, 2009 3:12 pm
Location: España
Contact:

Re: Castle Control Script

Post by kocinski » Thu May 20, 2010 12:11 am

And how can I add the Castle attackers?

Thanks.

User avatar
pinkcore
Posts: 247
Joined: Fri Jul 24, 2009 3:04 am
Location: Czech Republic

Re: Castle Control Script

Post by pinkcore » Sun Aug 08, 2010 2:36 pm

Stop using permissions 777 for files !!!!! Just use 755.
I'm not here only for food!

User avatar
disorder35
Posts: 700
Joined: Sat Aug 01, 2009 3:29 pm

Re: Castle Control Script

Post by disorder35 » Wed Aug 11, 2010 2:53 am

Yes good idea how can we add the siege attacker to this script? I was trying to do that the other day but couldn't do it.
So What?????

User avatar
pinkcore
Posts: 247
Joined: Fri Jul 24, 2009 3:04 am
Location: Czech Republic

Re: Castle Control Script

Post by pinkcore » Wed Aug 11, 2010 5:22 pm

disorder35 wrote:Yes good idea how can we add the siege attacker to this script? I was trying to do that the other day but couldn't do it.
Just use siege_clans table :)

Save all values to array, use Inner / Left / Right Join to translate clan_id to clan_name from clan_data table.
Sort all clans to Castle by castle_id and by type you determine Attackers / Defenders. :)
I can edit this script but i have too much work at this time :X

But why to do it in PHP script to website, players can read it easily through game at NPCs, I think is not good to make players more lazzy :))
I'm not here only for food!

User avatar
regenx
Posts: 319
Joined: Sat Jul 17, 2010 6:55 am

Re: Castle Control Script

Post by regenx » Tue Jan 11, 2011 2:07 pm

Nice work. Working for Freya Core: 4422 / DP: 7669 ?? Ty

User avatar
pinkcore
Posts: 247
Joined: Fri Jul 24, 2009 3:04 am
Location: Czech Republic

Re: Castle Control Script

Post by pinkcore » Tue Jan 11, 2011 3:23 pm

regenx wrote:Nice work. Working for Freya Core: 4422 / DP: 7669 ?? Ty
Yeah it works perfectly, there was no changes with castle siege since this long time.
I'm not here only for food!

seedanbu
Posts: 7
Joined: Sat Mar 13, 2010 2:38 am

Re: Castle Control Script

Post by seedanbu » Thu Jan 13, 2011 9:23 am

I'm trying to add a ally_name and leadername in this script with no success.
Can anyone help?

Code: Select all

<?php/* ----  Configuration  ---- */$noneed=1;include('castles/config.php'); // Print top of page /* ---- GIRAN ---- */$giranOwner = "no clan";$giranAlly = "no ally";$giranSiegeDate = " ... ";$giranTax ="";/* ---- OREN ---- */$orenOwner = "no clan";$orenAlly = "no ally";$orenSiegeDate = " ... ";$orenTax ="";/* ---- ADEN ---- */$adenOwner = "no clan";$adenAlly = "no ally";$adenSiegeDate = " ... ";$adenTax ="";/* ---- Gludio ---- */$gludioOwner = "no clan";$gludioAlly = "no ally";$gludioSiegeDate = "...";$gludioTax ="";/* ---- DION ---- */$dionOwner = "no clan";$dionAlly = "no ally";$dionSiegeDate = " ... ";$dionTax ="";/* ---- INNADRIL ---- */$innadrilOwner = "no clan";$innadrilAlly = "no ally";$innadrilSiegeDate = " ... ";$innadrilTax ="";/* ---- GODDARD ---- */$goddardOwner = "no clan";$goddardAlly = "no ally";$goddardSiegeDate = " ... ";$goddardTax ="";/* ---- RUNE ---- */$runeOwner = "no clan";$runeAlly = "no ally";$runeSiegeDate = " ... ";$runeTax ="";/* ---- SCHUTTGART ---- */$schuttgartOwner = "no clan";$schuttgartAlly = "no ally";$schuttgartSiegeDate = " ... ";$schuttgartTax ="";/* ---------------------- */$result = mysql_query("SELECT castle.name, clan_data.clan_name, clan_data.ally_name FROM castle,clan_data WHERE clan_data.hasCastle=castle.id");while($row= mysql_fetch_array($result,MYSQL_ASSOC)){switch($row['name']){case 'Giran':$giranOwner=$row['clan_name'];$giranAlly=$row['ally_name'];break;case 'Oren':$orenOwner=$row['clan_name'];$orenAlly=$row['ally_name'];break; case 'Aden':$adenOwner=$row['clan_name'];$adenAlly=$row['ally_name'];break;case 'Gludio':$gludioOwner=$row['clan_name'];$gludiolly=$row['ally_name'];break;case 'Dion':$dionOwner=$row['clan_name'];$dionAlly=$row['ally_name'];break;case 'Innadril':$innadrilOwner=$row['clan_name'];$innadrilAlly=$row['ally_name'];break;case 'Goddard':$goddardOwner=$row['clan_name'];$goddardAlly=$row['ally_name'];break;case 'Rune':$runeOwner=$row['clan_name'];$runeAlly=$row['ally_name'];break;case 'Schuttgart':$schuttgartOwner=$row['clan_name'];$schuttgartAlly=$row['ally_name'];break;}}$result = mysql_query("SELECT name,taxPercent,siegeDate FROM castle");while($row=mysql_fetch_array($result,MYSQL_ASSOC)){switch($row['name']){case 'Giran':$giranTax=$row['taxPercent'].'%';$giranSiegeDate=date('D\, j M Y H\:i',$row['siegeDate']/1000);break;case 'Oren':$orenTax=$row['taxPercent'].'%';$orenSiegeDate=date('D\, j M Y H\:i',$row['siegeDate']/1000);break;case 'Aden':$adenTax=$row['taxPercent'].'%';$adenSiegeDate=date('D\, j M Y H\:i',$row['siegeDate']/1000);break;case 'Gludio':$gludioTax=$row['taxPercent'].'%';$gludioSiegeDate=date('D\, j M Y H\:i',$row['siegeDate']/1000);break;case 'Dion':$dionTax=$row['taxPercent'].'%';$dionSiegeDate=date('D\, j M Y H\:i',$row['siegeDate']/1000);break;case 'Innadril':$innadrilTax=$row['taxPercent'].'%';$innadrilSiegeDate=date('D\, j M Y H\:i',$row['siegeDate']/1000);break;case 'Goddard':$goddardTax=$row['taxPercent'].'%';$goddardSiegeDate=date('D\, j M Y H\:i',$row['siegeDate']/1000);break;  case 'Rune':$runeTax=$row['taxPercent'].'%';$runeSiegeDate=date('D\, j M Y H\:i',$row['siegeDate']/1000);break; case 'Schuttgart':$SchuttgartTax=$row['taxPercent'].'%';$SchuttgartSiegeDate=date('D\, j M Y H\:i',$row['siegeDate']/1000);break;   }}?> <h1>Castle Siege</h1><!-- --------------------- ADEN --------------------- --><ul class="cs_table">  <li class="title_cs">    <h2>Aden Castle</h2>  </li>  <li class="img_castle"><img src="castles/imgcs/aden.jpg" alt="Aden Castle" /></li>  <li class="dono_cs">Data do Siege</li>  <li class="data_cs"><?php print $adenSiegeDate; ?></li>  <li class="dono_cs">Dono do Castelo</li>  <li class="data_cs"><?php print $adenOwner; ?></li>  <li class="dono_cs">Ally</li>  <li class="data_cs"><?php print $adenAlly; ?></li>  <li class="dono_cs">Clan Leader</li>  <li class="data_cs"><?php print $adenLeader; ?></li>  <li class="dono_cs">Taxa</li>  <li class="data_cs"><?php print $adenTax; ?></li>  <li class="espaco">&nbsp;</li>  <li class="atac_cs">Atacantes</li>  <li class="def_cs">Defensores</li>  <li class="atac_cs">    <?php$result = mysql_query("SELECT clan_id FROM siege_clans WHERE castle_id='5' AND type='1'");while($row=mysql_fetch_array($result)){$result2 = mysql_query("SELECT clan_name FROM clan_data WHERE clan_id='$row[0]'"); while($row2=mysql_fetch_array($result2)){print $row2[0];print'<br />';}} ?>    &nbsp;</li>  <li class="def_cs">    <?php$result = mysql_query("SELECT clan_id FROM siege_clans WHERE castle_id='5' AND type='0'");while($row=mysql_fetch_array($result)){$result2 = mysql_query("SELECT clan_name FROM clan_data WHERE clan_id='$row[0]'");while($row2=mysql_fetch_array($result2)){print $row2[0];print'<br />';if($row2[0]!=""){$s11="1";break;}}}if($s11=="1"){print '';}elseprint 'NPC';?>  </li></ul><br class="clear" /><div class="divisor"><img src="imagens/divisor.png" alt="divisor" /></div> 

User avatar
u3games
Posts: 1156
Joined: Sun Feb 27, 2011 7:00 pm
Location: España
Contact:

Re: Castle Control Script

Post by u3games » Sun May 01, 2011 10:51 pm

error in generator.php:
Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\castle\generator.php on line 57

Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\castle\generator.php on line 57

Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\castle\generator.php on line 57

Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\castle\generator.php on line 57

Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\castle\generator.php on line 57

Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\castle\generator.php on line 57

Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\castle\generator.php on line 57

Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\castle\generator.php on line 57

Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\castle\generator.php on line 57
any suggestions?
Image

User avatar
malkavcrow
Posts: 5
Joined: Wed Mar 02, 2011 1:22 am

Re: Castle Control Script

Post by malkavcrow » Tue May 10, 2011 11:46 pm

janiii wrote:i am not really a design guru, so feel free to change the design :)
is only basic functionality, so if someone makes it better, i would be happy to see it :) or if someone has ideas how it should look like, me (or someone else) can change the code :)

v2 - cache version (better use this one):
data is read from objects already loaded by gameserver

voice commands: .castle and .siege


Image
I downloaded the file twice and in both, the message of corrupted file. It happened just me?

User avatar
shinomidefuego
Posts: 122
Joined: Thu Jun 28, 2007 5:37 pm
Location: Venezuela
Contact:

Re: Castle Control Script

Post by shinomidefuego » Tue May 17, 2011 3:47 pm

nice, works perfect in freya, thanks!!!

i adapted to my site and looks good
Image
MMMMMmmmmmMMMMM

bady
Posts: 21
Joined: Mon Jun 23, 2008 7:51 pm

Re: Castle Control Script

Post by bady » Sun Jun 12, 2011 1:42 am

the etcitem table doesnt exist anymore, so the script shows an error:

Code: Select all

 Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in xxxx/generator.php on line 57
by the way, voice commands script is corrupt :( i cant open it

User avatar
St3eT
Posts: 961
Joined: Sun Mar 07, 2010 6:50 pm

Re: Castle Control Script

Post by St3eT » Sun Jun 26, 2011 7:59 am

Yes already is ectitem in XML. Any idea?
If i should be black sheep for sure no as punishment
Image

gameblond
Posts: 53
Joined: Wed Jun 23, 2010 11:56 am

Re: Castle Control Script

Post by gameblond » Mon Jul 18, 2011 8:18 pm

Old topic but Daedalus is guarantee :P

I have one problem On Local Diskw i got the Time that siege will begin correct ex. Controlled by: UNCLAIMED
Next Siege: Jul 24 2011 08:00PM EEST

But on website : Controlled by: UNCLAIMED
Next Siege: Jul 24 2011 01:00PM EDT

I think because of timezone of site hosting company?

I have put the correct permissions to file helios.

edit: $gen .= '<div><strong>Next Siege:</strong> ' . date('M d Y h:iA ',$castle['siegeDate']/1000) . ' ' . date('T') . '</div>';
here is the code that i must add timezone +2 GMt

Post Reply