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

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

Author Topic: GUI module  (Read 17361 times)

0 Members and 1 Guest are viewing this topic.

Offline Monk4y

  • BeBot User
  • **
  • Posts: 23
  • Karma: +0/-0
GUI module
« on: March 29, 2010, 03:42:14 pm »
Well, its not really a module, its more like a bunch of in game commands in a big long script but I find it useful for quickly changing settings in game without messing about with built in menus.

Typical use would be, showing newbies how their settings should be, certain raids where you wannt turn off particles etc etc.

Copy the code or download the file and put the gui.php file in the aoc modules directory. Type: !gui in guildchat or in a tell to your bot and it will work fine.

If you like it help yourself and use it.  :P (here is a link to the file CLICK or you can copy the code below.

Code: [Select]
<?php
/*
*
*
*
*
*/
$gui = new gui($bot);

class 
gui extends BaseActiveModule
{

function __construct(&$bot)
{
parent::__construct(&$botget_class($this));

$this -> register_command('all''gui'"ANONYMOUS");

$this -> bot -> core("colors") -> define_scheme("GI""highlight""yellow");
$this -> bot -> core("colors") -> define_scheme("GI""normal""white");
$this -> bot -> core("colors") -> define_scheme("GI""info""lightgreen");
$this -> bot -> core("colors") -> define_scheme("GI""orange""orange");
$this -> bot -> core("colors") -> define_scheme("GI""blue""blue");

$this -> help['description'] = 'A very basic GUI module, converted from a guild recruitment module.';
}

function command_handler($name$msg$origin)
{
if (preg_match('/^gui/i'$msg$info)) {
$words trim(substr($msgstrlen('gui')));
if ($words == "members"
{
return $this -> memberslist();
} else if($words == "classes") {
return $this -> memberscount();
} else {
return $this -> info();
}
} else if(preg_match('/^grecruit/i'$msg$info)) {
//return "Command under development";
$msg $this -> recruit();
$channel $this -> bot -> core("chat") -> lookup_group("Playfield");
return "Currently under development: ".$channel;
} else {
$this -> bot -> send_help($name);
}
}

/*
gui Info
*/
function info()
{
$txt.= "##GI_highlight##Gui 1.0##end##\n";
$txt.= "##GI_info##All recomended settings marked with an Asterix (*)##end##<br>";
$txt.= "##GI_highlight##--You--##end##\n";
$txt.= "1. Show MY Cloak |<a href='chatcmd:///setoption RenderSetting_HideMyCloak 1'>Off</a>|<a href='chatcmd:///setoption RenderSetting_HideMyCloak 0'>On</a>\n";

$txt.= "2. Show MY Helmet |<a href='chatcmd:///setoption RenderSetting_HideMyHelmet 1'>Off</a>|<a href='chatcmd:///setoption RenderSetting_HideMyHelmet 0'>On</a>|\n";

$txt.= "3. Show MY Details |<a href='chatcmd:///setoption ShowMyDetails 0'>Off</a>|<a href='chatcmd:///setoption ShowMyDetails 1'>On</a>|\n";

$txt.= "4. Show MY Healthbar |<a href='chatcmd:///setoption ShowMyHealthbar 0'>Off</a>|<a href='chatcmd:///setoption ShowMyHealthbar 1'>On</a>|\n";

$txt.= "5. Show MY Name |<a href='chatcmd:///setoption ShowMyName 0'>Off</a>|<a href='chatcmd:///setoption ShowMyName 1'>On</a>|\n";

$txt.= "6. Auto Facing |<a href='chatcmd:///setoption AutofacingTarget false'>Off*</a>|<a href='chatcmd:///setoption AutofacingTarget true'>On</a>|\n";

$txt.= "7. Auto Target |<a href='chatcmd:///setoption AutoTarget false'>Off*</a>|<a href='chatcmd:///setoption AutoTarget true'>On</a>|\n";

$txt.= "8. Show MY Gear (allow inspection) |<a href='chatcmd:///setoption RenderSetting_HideInspectOption true'>Hide</a>|<a href='chatcmd:///setoption RenderSetting_HideInspectOption false'>Show</a>|\n";

$txt.= "9. Show Shields: |<a href='chatcmd:///setoption ShowShields 2'>Allways*</a>|<a href='chatcmd:///setoption ShowShields 1'>When Blocking</a>|<a href='chatcmd:///setoption ShowShields 0'>Never</a>|\n";

$txt.= "10. Camera Follow Mode: |<a href='chatcmd:///setoption CameraFollow 2'>Never*</a>|<a href='chatcmd:///setoption CameraFollow 1'>Auto Level</a>|<a href='chatcmd:///setoption CameraFollow 0'>Auto</a>|<br>&nbsp;<br>";

$txt.= "##GI_highlight##--Other Players--##end##\n";

$txt.= "11. Show Player Details <a href='chatcmd:///setoption ShowVicinityPlayerDetails 0'>Off*</a> | <a href='chatcmd:///setoption ShowVicinityPlayerDetails 1'>On</a>\n";

$txt.= "12. Show Player Healthbars <a href='chatcmd:///setoption ShowVicinityPlayerHealthbar false'>Off</a> | <a href='chatcmd:///setoption ShowVicinityPlayerHealthbar true'>On*</a>\n";

$txt.= "13. Show Player Names <a href='chatcmd:///setoption ShowVicinityPlayerNames 0'>Off</a> | <a href='chatcmd:///setoption ShowVicinityPlayerNames 1'>On*</a>\n";

$txt.= "14. Show Player Level <a href='chatcmd:///setoption ShowVicinityPlayerLevel 0'>Off*</a> | <a href='chatcmd:///setoption ShowVicinityPlayerLevel 1'>On</a>\n";

$txt.= "15. Show Player Tooltips <a href='chatcmd:///setoption ShowPlayerTooltip false'>Off*</a> | <a href='chatcmd:///setoption ShowPlayerTooltip true'>On</a><br>&nbsp;<br>";

$txt.= "##GI_highlight##--NPC's--##end##\n";

$txt.= "16. Show NPC Details |<a href='chatcmd:///setoption ShowVicinityNPCDetails 0'>Off</a>|<a href='chatcmd:///setoption ShowVicinityNPCDetails 1'>On*</a>|\n";

$txt.= "17. Show NPC Healthbars |<a href='chatcmd:///setoption ShowVicinityNPCHealthbar false'>Off*</a>|<a href='chatcmd:///setoption ShowVicinityNPCHealthbar true'>On</a>|\n";

$txt.= "18. Show NPC Names |<a href='chatcmd:///setoption ShowVicinityNPCNames 0'>Off</a>|<a href='chatcmd:///setoption ShowVicinityNPCNames 1'>On*</a>|<br>&nbsp;<br>";

$txt.= "##GI_highlight##--The GUI/Overlay--##end##\n";

$txt.= "19. Radar |<a href='chatcmd:///setoption radar_window 0'>Off</a>|<a href='chatcmd:///setoption radar_window 1'>On*</a>|\n";

$txt.= "20. Show Quest Tracker |<a href='chatcmd:///setoption quest_tracker_window false'>Off</a>|<a href='chatcmd:///setoption quest_tracker_window true'>On</a>|\n";

$txt.= "21. Show Targets Target |<a href='chatcmd:///setoption ShowTargetsTarget 0'>Off</a>|<a href='chatcmd:///setoption ShowTargetsTarget 1'>On*</a>|\n";

$txt.= "22. Show Targets Target Portrait Window |<a href='chatcmd:///setoption floating_targetstargetportrait_window false'>Off</a>|<a href='chatcmd:///setoption floating_targetstargetportrait_window true'>On*</a>|\n";

$txt.= "23. Show Timer Bar |<a href='chatcmd:///setoption DisplayTimerBar false'>Off</a>|<a href='chatcmd:///setoption DisplayTimerBar true'>On*</a>|\n";

$txt.= "24. Bottom Bar Tooltips |<a href='chatcmd:///setoption BottomBarShowTooltips false'>Off*</a>|<a href='chatcmd:///setoption BottomBarShowTooltips true'>On</a>|\n";

$txt.= "25. Chat Window Transparency Active: |<a href='chatcmd:///setoption ChatTransparencyActive 1.000000'>0%*</a>|<a href='chatcmd:///setoption ChatTransparencyActive 0.750000'>25%</a>|<a href='chatcmd:///setoption ChatTransparencyActive 0.500000'>50%</a>|<a href='chatcmd:///setoption ChatTransparencyActive 0.2500000'>75%</a>|<a href='chatcmd:///setoption ChatTransparencyActive 0.000000'>100%</a>|\n";

$txt.= "26. Chat Window Transparency Inactive: |<a href='chatcmd:///setoption ChatTransparencyInactive 1.000000'>0%*</a>|<a href='chatcmd:///setoption ChatTransparencyInactive 0.750000'>25%</a>|<a href='chatcmd:///setoption ChatTransparencyInactive 0.500000'>50%</a>|<a href='chatcmd:///setoption ChatTransparencyInactive 0.2500000'>75%</a>|<a href='chatcmd:///setoption ChatTransparencyInactive 0.000000'>100%</a>|\n\n";

$txt.= "##GI_highlight##--Particles and GFX--##end##\n";

$txt.= "27. 3D Damage Numbers |<a href='chatcmd:///setoption Show3DDamageText false'>Off</a>|<a href='chatcmd:///setoption Show3DDamageText true'>On*</a>|OFF for Seruah and Sabazious\n";

$txt.= "28. Show Mana & Stamina Regens |<a href='chatcmd:///setoption HideManaStaminaRegen true'>Off</a>|<a href='chatcmd:///setoption HideManaStaminaRegen void'>On</a>|OFF for BS and DT\n";

$txt.= "29. Incoming damage numbers display threshold: |<a href='chatcmd:///setoption IgnoreIncomingDamageNumbersValue 0'>None</a>|<a href='chatcmd:///setoption IgnoreIncomingDamageNumbersValue 25'>25</a>|<a href='chatcmd:///setoption IgnoreIncomingDamageNumbersValue 50'>50*</a>|<a href='chatcmd:///setoption IgnoreIncomingDamageNumbersValue 100'>100</a>|\n";

$txt.= "30. Outgoing damage numbers display threshold: <a href='chatcmd:///setoption IgnoreOutgoingDamageNumbersValue 0'>None</a>|<a href='chatcmd:///setoption IgnoreOutgoingDamageNumbersValue 25'>25</a>|<a href='chatcmd:///setoption IgnoreOutgoingDamageNumbersValue 50'>50*</a>|<a href='chatcmd:///setoption IgnoreOutgoingDamageNumbersValue 100'>100</a>|\n";

$txt.= "31. Particles |<a href='chatcmd:///setoption DebugRenderSetting_EnableParticles false'>Off</a>|<a href='chatcmd:///setoption DebugRenderSetting_EnableParticles true'>On*</a>|OFF for Seruah and Sabazious\n";

$txt.= "32. Show Particles in: |<a href='chatcmd:///setoption SpellEffect_DisplayLevel 0'>ALL</a>|<a href='chatcmd:///setoption SpellEffect_DisplayLevel 1'>RAID</a>|<a href='chatcmd:///setoption SpellEffect_DisplayLevel 2'>GROUP*</a>|<a href='chatcmd:///setoption SpellEffect_DisplayLevel 3'>MYSELF</a>|<a href='chatcmd:///setoption SpellEffect_DisplayLevel 4'>NONE</a>|Group, Myself or None\n";

$txt.= "32. Splash Screen Fade IN&OUT |<a href='chatcmd:///setoption SplashScreenFadeInTime 0'>IN 0*</a>|<a href='chatcmd:///setoption SplashScreenFadeInTime 5'>IN 5</a>|<a href='chatcmd:///setoption SplashScreenFadeOutTime 0'>OUT 0*</a>|<a href='chatcmd:///setoption SplashScreenFadeOutTime 5'>OUT 5</a>|\n";

$txt.= "34. Shadows |<a href='chatcmd:///setoption RenderSetting_ShadowMapType 0'>Disabled</a>|<a href='chatcmd:///setoption RenderSetting_ShadowMapType 2'>Characters Only*</a>|<a href='chatcmd:///setoption RenderSetting_ShadowMapType 1'>Everything</a>|\n";

$txt.= "35. Fullscreen |<a href='chatcmd:///setoption FullScreen 0'>Off</a>|<a href='chatcmd:///setoption FullScreen 1'>On</a>|<br /><br><br /><br>";


return $this -> bot -> core("tools") -> make_blob("Gui 1.01"$txt);
}
/*
Still working on this, for now just some random debugging stuff I was trying
*/
function recruit()
{
$blob "GUI: '";
$blob.= $this -> info();
$blob.= " Playfield ID: ";
return $blob;

}

/*
Need to revize so it just uses core
*/
function memberslist()
{
$blob "";
$count 0;
$result $this -> bot -> db -> select("SELECT nickname, last_seen FROM #___users WHERE user_level = " MEMBER " ORDER BY nickname ASC");
if (!empty($result))
{
$inside "##blob_title##:::: <botname>'s Member List ::::##end##\n &nbsp; \n";
foreach ($result as $val)
{
$count++;
$inside .= "##blob_text##&#8226; " $val[0];
if ($val[1] > 0)
{
$inside .= ", last seen at " gmdate($this -> bot -> core("settings") -> get("Time""FormatString"), $val[1]);
}
else
{
$inside .= ", never seen online";
}
$inside .= "##end## ".$this -> bot -> core("tools") -> chatcmd("whois " $val[0], "[Whois]")."\n";
}
$blob " :: " $this -> bot -> core("tools") -> make_blob("click to view"$inside);
}
return $count " Guild Members:" $blob;
}

/*
Need to revize so it just uses core
*/
function memberscount()
{
$blob "";
$total 0;

$buddies count($this -> bot -> aoc -> buddies);
//Get a list of professions
$profession_list "'".$this->bot->core('professions')->get_professions("', '")."'";
$counts $this -> bot -> db -> select("SELECT t2.class, COUNT(DISTINCT t1.nickname) 
FROM #___users AS t1 LEFT JOIN #___whois AS t2 ON t1.nickname = t2.nickname
 WHERE user_level = " 
MEMBER " AND t2.class IN ($profession_list) GROUP BY class");

foreach ($this -> bot->core('professions')->get_profession_array() as $prof)
$count[$prof] = 0;
if (!(empty($counts)))
{
foreach ($counts as $profcount)
{
$count[$profcount[0]] += $profcount[1];
$total += $profcount[1];
}
}

$inside "##blob_title##:::: <botname>'s Member Count ::::##end##\n";
$inside .= "\n##blob_text##Buddy List Count: ##blob_title##".$buddies."##end##\n";
foreach ($count as $key => $value)
$inside .= "\n&#8226; ".$key." = ##blob_title##".$value."##end##";
$blob " :: " $this -> bot -> core("tools") -> make_blob("click to view"$inside);

return $total " Guild Classes:" $blob;
}
}
?>


Edit: here is a ss of a slightly earlier version.
The newer version here has some slightly different options - but you can see what it looks like here.
« Last Edit: April 02, 2010, 10:16:22 pm by Khalem »

Offline fowlskins

  • BeBot User
  • **
  • Posts: 33
  • Karma: +0/-0
Re: GUI module
« Reply #1 on: March 29, 2010, 11:58:53 pm »
thanks for this
 really like this module
nice to have all that customisation in one place with just one click

Offline Kyr

  • BeBot Apprentice
  • ***
  • Posts: 177
  • Karma: +0/-0
Re: GUI module
« Reply #2 on: March 30, 2010, 04:04:18 am »
Very nice, thanks!

~Kyr

Offline Mixima

  • BeBot Rookie
  • *
  • Posts: 6
  • Karma: +0/-0
Re: GUI module
« Reply #3 on: March 31, 2010, 01:06:27 am »
cant get this to work :(
Is it possible for you to attach the file, so i dont miss any formatting?

Thx - it looks great and i want it :)

Offline Monk4y

  • BeBot User
  • **
  • Posts: 23
  • Karma: +0/-0
Re: GUI module
« Reply #4 on: March 31, 2010, 01:19:06 am »
I put a link to the file in the op

Offline Mixima

  • BeBot Rookie
  • *
  • Posts: 6
  • Karma: +0/-0
Re: GUI module
« Reply #5 on: March 31, 2010, 01:26:53 am »
thx :)

Offline Apollyon

  • BeBot User
  • **
  • Posts: 21
  • Karma: +0/-0
Re: GUI module
« Reply #6 on: March 31, 2010, 10:17:18 pm »
Was actually considering make a script to do some of this.  Will be nice to save me the time of doing that.

Offline TBK

  • BeBot User
  • **
  • Posts: 26
  • Karma: +0/-0
Re: GUI module
« Reply #7 on: April 02, 2010, 03:17:07 am »
Thx m8  ;)

Offline Getrix

  • Contributor
  • *******
  • Posts: 509
  • Karma: +0/-0
Re: GUI module
« Reply #8 on: April 02, 2010, 11:01:14 am »
Thanks!

There is a minor "bug" in the Code posted there. Remove the ' before <?php
Success is not final, failure is not fatal: it is the courage to continue that counts.
- Sorry, i dont have time to reply question on PM. Make a topic.

Offline Khalem

  • BeBot Founder
  • Administrator
  • ********
  • Posts: 1169
  • Karma: +0/-0
    • http://www.ancarim.com
Re: GUI module
« Reply #9 on: April 02, 2010, 10:16:43 pm »
Thanks!

There is a minor "bug" in the Code posted there. Remove the ' before <?php

Fixed
BeBot Founder and Fixer Kingpin

 

* Recent Posts
0.8.x updates for AO by bitnykk
[June 23, 2024, 03:19:47 pm ]


0.8.x updates for AoC by bitnykk
[June 23, 2024, 03:19:44 pm ]


[AoC] special char for items module by bitnykk
[February 09, 2024, 09:41:18 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: 334
  • 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