BeBot - An Anarchy Online and Age Of Conan chat automaton

Development => Coding and development discussion => Topic started by: Temar on July 09, 2007, 06:29:29 pm

Title: faction checking
Post by: Temar on July 09, 2007, 06:29:29 pm
Code: [Select]
    function faction_check($name, $mode, $faction)
{
$this -> bot -> aoc -> get_uid($name)
if ($mode == exclude){
line 69>>> if ($who["faction"] !== $faction { return 0; }}
else if ($who["faction"] == $faction { return 1; }
else return false;

Quote
Parse error: syntax error, unexpected '"', expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/Bots/Testbot/modules/AutoMember.php on line 69
Title: Re: faction checking
Post by: Temar on July 09, 2007, 06:30:25 pm
basicly i wana add Faction checking and min level checking
to a module
useing wat is set with flexible security
Title: Re: faction checking
Post by: Alreadythere on July 09, 2007, 07:19:00 pm
You're missing ) each time after the comparison.
Title: Re: faction checking
Post by: Temar on July 09, 2007, 10:59:16 pm
oops
Title: Re: faction checking
Post by: Temar on July 09, 2007, 11:04:03 pm
done that but error stiff coming up
Title: Re: faction checking
Post by: Temar on July 09, 2007, 11:11:09 pm
maybe its somit to do with the $who["faction"]
im not sure if that correct
because its from an old module
Title: Re: faction checking
Post by: Khalem on July 10, 2007, 02:07:01 am
That entire codeblock is non functional.

Code: [Select]
<?php
    
// Ok, your passing $name, $mode and $faction
    
function faction_check($name$mode$faction)
{
                
// This makes no sense, your asking the bot to just lookup the UID, but you dont store it anywhere.
$this -> bot -> aoc -> get_uid($name)

                
// Wont work, you'll likely be looking for 'exclude'
if ($mode == exclude){

                
// $who doesnt exsist. Maybe your looking to do a whois lookup? You are also missing a closing )
if ($who["faction"] !== $faction { return 0; }}
                
// Should read:
                
if ($who["faction"] !== $faction) { return 0; }}

                
// Same as both above
else if ($who["faction"] == $faction { return 1; } 
else return false;
?>

Title: Re: faction checking
Post by: Temar on July 10, 2007, 04:01:10 am
some 1 wana write me a new 1 then :p
basicly want somthing to check faction and minlevel
which i will set useing with normal bot settings
didnt wana use flexible security as some might not be useing it so dont want it to req it

the use will be when some 1 joins a private group if it check there faction and min level and if they meet the req it will do somit
Title: Re: faction checking
Post by: Khalem on July 10, 2007, 09:36:27 pm
some 1 wana write me a new 1 then :p
basicly want somthing to check faction and minlevel
which i will set useing with normal bot settings
didnt wana use flexible security as some might not be useing it so dont want it to req it

the use will be when some 1 joins a private group if it check there faction and min level and if they meet the req it will do somit

With all due respect, this is pretty much why Flexible security was added, to do just what your asking.
Except it wont actually grant them access in the first place if they do not meet the requirements.
Title: Re: faction checking
Post by: Temar on July 10, 2007, 11:09:52 pm
i wasnt sure if having the need to setup flexible security was nessesary
the module im make if to add people who join pgroup and are not on member list but need to meet a few req like being clan
Title: Re: faction checking
Post by: Alreadythere on July 11, 2007, 12:39:21 am
One of the ideas behind flexible security is the ability to define user groups without keeping an explicit listing of them. This is archieved by matching them to some characteristics defined by level, faction, profession, org membership and org rank.
SimplePortal 2.3.7 © 2008-2025, SimplePortal