Archive > AoC 0.6.x Custom/Unofficial modules

GUI module

(1/2) > >>

Monk4y:
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: ---<?php
/*
*
*
*
*
*/
$gui = new gui($bot);

class gui extends BaseActiveModule
{

function __construct(&$bot)
{
parent::__construct(&$bot, get_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($msg, strlen('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;
}
}
?>

--- End code ---

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.

fowlskins:
thanks for this
 really like this module
nice to have all that customisation in one place with just one click

Kyr:
Very nice, thanks!

~Kyr

Mixima:
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 :)

Monk4y:
I put a link to the file in the op

Navigation

[0] Message Index

[#] Next page

Go to full version