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

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

Author Topic: faction checking  (Read 3162 times)

0 Members and 1 Guest are viewing this topic.

Offline Temar

  • Contributor
  • *******
  • Posts: 1140
  • Karma: +0/-0
    • AoFiles
faction checking
« 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

Offline Temar

  • Contributor
  • *******
  • Posts: 1140
  • Karma: +0/-0
    • AoFiles
Re: faction checking
« Reply #1 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

Offline Alreadythere

  • BeBot Maintainer
  • BeBot Hero
  • ******
  • Posts: 1288
  • Karma: +0/-0
Re: faction checking
« Reply #2 on: July 09, 2007, 07:19:00 pm »
You're missing ) each time after the comparison.

Offline Temar

  • Contributor
  • *******
  • Posts: 1140
  • Karma: +0/-0
    • AoFiles
Re: faction checking
« Reply #3 on: July 09, 2007, 10:59:16 pm »
oops

Offline Temar

  • Contributor
  • *******
  • Posts: 1140
  • Karma: +0/-0
    • AoFiles
Re: faction checking
« Reply #4 on: July 09, 2007, 11:04:03 pm »
done that but error stiff coming up

Offline Temar

  • Contributor
  • *******
  • Posts: 1140
  • Karma: +0/-0
    • AoFiles
Re: faction checking
« Reply #5 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

Offline Khalem

  • BeBot Founder
  • Administrator
  • ********
  • Posts: 1169
  • Karma: +0/-0
    • http://www.ancarim.com
Re: faction checking
« Reply #6 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;
?>

BeBot Founder and Fixer Kingpin

Offline Temar

  • Contributor
  • *******
  • Posts: 1140
  • Karma: +0/-0
    • AoFiles
Re: faction checking
« Reply #7 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

Offline Khalem

  • BeBot Founder
  • Administrator
  • ********
  • Posts: 1169
  • Karma: +0/-0
    • http://www.ancarim.com
Re: faction checking
« Reply #8 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.
BeBot Founder and Fixer Kingpin

Offline Temar

  • Contributor
  • *******
  • Posts: 1140
  • Karma: +0/-0
    • AoFiles
Re: faction checking
« Reply #9 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

Offline Alreadythere

  • BeBot Maintainer
  • BeBot Hero
  • ******
  • Posts: 1288
  • Karma: +0/-0
Re: faction checking
« Reply #10 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.

 

* Recent Posts
[AoC] special char for items module by bitnykk
[February 09, 2024, 09:41:18 pm]


0.8.x updates for AoC by bitnykk
[January 30, 2024, 11:16:08 pm]


0.8.x updates for AO by bitnykk
[January 30, 2024, 11:15:37 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: 522
  • 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