<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-gb">
	<link rel="self" type="application/atom+xml" href="https://forum.eggheads.org/app.php/feed/topic/8526" />

	<title>egghelp/eggheads community</title>
	<subtitle>Discussion of eggdrop bots, shell accounts and tcl scripts.</subtitle>
	<link href="https://forum.eggheads.org/index.php" />
	<updated>2005-04-18T10:17:46-04:00</updated>

	<author><name><![CDATA[egghelp/eggheads community]]></name></author>
	<id>https://forum.eggheads.org/app.php/feed/topic/8526</id>

		<entry>
		<author><name><![CDATA[Galadhrim]]></name></author>
		<updated>2005-04-18T10:17:46-04:00</updated>

		<published>2005-04-18T10:17:46-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=48260#p48260</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=48260#p48260"/>
		<title type="html"><![CDATA[User Flag Checking]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=48260#p48260"><![CDATA[
Yay I found it by accident <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_biggrin.gif" width="15" height="15" alt=":D" title="Very Happy"> <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_biggrin.gif" width="15" height="15" alt=":D" title="Very Happy"> <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_biggrin.gif" width="15" height="15" alt=":D" title="Very Happy"><br><div class="codebox"><p>Code: </p><pre><code>if( strlen(u-&gt;handle)&gt;0){struct flag_record fr = { FR_GLOBAL, 0, 0, 0, 0, 0 };    char x[100];    fr.global = u-&gt;flags;fr.udef_global = u-&gt;flags_udef;    build_flags(x, &amp;fr, 0);    dprintf(DP_SERVER, "privmsg %s : User %s :\r\n", chan, u-&gt;handle);dprintf(DP_SERVER, "privmsg %s :  flags: %s;\r\n", chan, x);if(strstr(x, "S") != NULL) dprintf(DP_SERVER, "privmsg %s : %s  has flag S\r\n", chan, u-&gt;handle);if(strstr(x, "I") != NULL) dprintf(DP_SERVER, "privmsg %s : %s has flag I\r\n", chan, u-&gt;handle);    }</code></pre></div>So when you set the global flags for the user in the partyline you can use this to check for flags.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2999">Galadhrim</a> — Mon Apr 18, 2005 10:17 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Galadhrim]]></name></author>
		<updated>2005-04-18T09:41:41-04:00</updated>

		<published>2005-04-18T09:41:41-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=48259#p48259</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=48259#p48259"/>
		<title type="html"><![CDATA[User Flag Checking]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=48259#p48259"><![CDATA[
*bump* <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_biggrin.gif" width="15" height="15" alt=":D" title="Very Happy"><br><br>After giving up last October I've found some time to go through alot of code and found the corresponding structs and function that allow you to look for the required flags.<br><div class="codebox"><p>Code: </p><pre><code>/* * The user record. You can find this using get_user_by_handle(userlist, text); * Neither variables have to be malloc'ed before hand. The variable userlist is global and already filled by the bot. */struct userrec {struct userrec *next;char handle[HANDLEN + 1];unsigned long flags;unsigned long flags_udef;struct chanuserrec *chanrec;struct user_entry *entries;};/* * The user record of a channel. You can access this via the struct member variable *chanrec.  */struct chanuserrec {struct chanuserrec *next;char channel[81];time_t laston;unsigned long flags;unsigned long flags_udef;char *info;};/* * The flag record of a user. You can find this using getget_user_flagrec(u, fr, u-&gt;handle); * Neither variables have to be malloc'ed before hand. */struct flag_record {int match;int global;int udef_global;int bot;int chan;int udef_chan;};</code></pre></div>Now the only thing I can't seem to find is how to check for the user flags A-Z. According to the code they are available for programmers to use, but I cannot find anything to check for them. There is a function called bread_down_flags(), but I have no idea how to use it.<br><br>When I print the flags in IRC for my admin user (afghjlmnoptvwxW) i get these numbers. I can check them with the preset hex values and see if I'm global op or master, but again not the user definable flags:<br><div class="codebox"><p>Code: </p><pre><code>dprintf(DP_SERVER, "privmsg %s : flag_record: match: %i; global: %i; udef_global: %i; bot: %i; chan: %i; udef_chan: %i;\r\n", chan, fr-&gt;match, fr-&gt;global, fr-&gt;udef_global, fr-&gt;bot, fr-&gt;chan, fr-&gt;udef_chan);</code></pre></div>gives:<div class="codebox"><p>Code: </p><pre><code> flag_record: match: 134938216; global: 0; udef_global: 0; bot: 0; chan: 135003104; udef_chan: 135001216;</code></pre></div>Silly thing is that the variable global is empty but the match is filled. The match variable is the global value  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_eek.gif" width="15" height="15" alt=":shock:" title="Shocked"> I have no idea what the chan variable is for but I never use channel flags so that ok for me.<br><br>Is there anyone who knows what to look for? I can try and use the empty flags I and S but those might be used in later versions. I just want to use the flags W and V <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_cry.gif" width="15" height="15" alt=":cry:" title="Crying or Very sad"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2999">Galadhrim</a> — Mon Apr 18, 2005 9:41 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Galadhrim]]></name></author>
		<updated>2004-10-29T15:00:57-04:00</updated>

		<published>2004-10-29T15:00:57-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=42395#p42395</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=42395#p42395"/>
		<title type="html"><![CDATA[User Flag Checking]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=42395#p42395"><![CDATA[
I've been looking all over the source files and website but I cant seem to find a number of functions that will alow me to directly or indirectly check for a flag. I've found all sorts of functions that do a little or less.<br><br>I want users that have the flag +W to allow to use certain commands. All the function should do is return false or true. But when I use some functions the compiler can't find the struct or function. Adding the according .h file to my module will results in more errors...<br><br>Does anyone have a used bit of code that I can use or does someone have ideas as to which functions I have to use?<br><br>Most functions are small and need the help of 100 other functions. Can't believe I can't find a function that lets developers check for a flag. My general opinion is that the eggdrop is created in a rush and the support for third party modules has been hacked into it by other people...  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_cry.gif" width="15" height="15" alt=":cry:" title="Crying or Very sad"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2999">Galadhrim</a> — Fri Oct 29, 2004 3:00 pm</p><hr />
]]></content>
	</entry>
	</feed>
