<?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/20835" />

	<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>2020-08-13T12:11:17-04:00</updated>

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

		<entry>
		<author><name><![CDATA[Pauschi]]></name></author>
		<updated>2020-08-13T12:11:17-04:00</updated>

		<published>2020-08-13T12:11:17-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=108873#p108873</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=108873#p108873"/>
		<title type="html"><![CDATA[&quot;Visit&quot; URL with command .pizza]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=108873#p108873"><![CDATA[
Thank you! It works  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12817">Pauschi</a> — Thu Aug 13, 2020 12:11 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[CrazyCat]]></name></author>
		<updated>2020-08-13T05:44:38-04:00</updated>

		<published>2020-08-13T05:44:38-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=108871#p108871</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=108871#p108871"/>
		<title type="html"><![CDATA[&quot;Visit&quot; URL with command .pizza]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=108871#p108871"><![CDATA[
<blockquote class="uncited"><div>Since he has <em class="text-italics">if-else</em> there no need for <em class="text-italics">die</em> actually.</div></blockquote>And more things, as<br>- $_GET is deprecated, using of filter_input(INPUT_GET, 'user') is better,<br>- $user is setted, but the if uses $_GET and not $user,<br>- if bier_$user.txt doesn't exists, error appear,<br>- ...<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=691">CrazyCat</a> — Thu Aug 13, 2020 5:44 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2020-08-13T00:32:08-04:00</updated>

		<published>2020-08-13T00:32:08-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=108870#p108870</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=108870#p108870"/>
		<title type="html"><![CDATA[&quot;Visit&quot; URL with command .pizza]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=108870#p108870"><![CDATA[
Since he has <em class="text-italics">if-else</em> there no need for <em class="text-italics">die</em> actually.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Thu Aug 13, 2020 12:32 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[CrazyCat]]></name></author>
		<updated>2020-08-12T17:57:46-04:00</updated>

		<published>2020-08-12T17:57:46-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=108867#p108867</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=108867#p108867"/>
		<title type="html"><![CDATA[&quot;Visit&quot; URL with command .pizza]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=108867#p108867"><![CDATA[
Log is clear: data are sent with POST, not GET.<br>So, adapt your php if you can (post is more secure than get) or modify the script to force usage of get:<div class="codebox"><p>Code: </p><pre><code>set tok [::http::geturl $::desturl -method "GET" -query $query]</code></pre></div>P.S.: I hope your PHP is just a POC, because you use depreciated things, too much die, ... really bad code <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=691">CrazyCat</a> — Wed Aug 12, 2020 5:57 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Pauschi]]></name></author>
		<updated>2020-08-12T08:27:28-04:00</updated>

		<published>2020-08-12T08:27:28-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=108866#p108866</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=108866#p108866"/>
		<title type="html"><![CDATA[&quot;Visit&quot; URL with command .pizza]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=108866#p108866"><![CDATA[
Thanks Again CrazyCat!<br><br>When i check my Apache2 Logs,<br>only pizza.php gets triggered, without ?user=&lt;$nick&gt;<br><div class="codebox"><p>Code: </p><pre><code>"POST /pizza.php HTTP/1.1" 200 220 "-" "Tcl http client package 2.7.13"</code></pre></div>pizza.php:<br><div class="codebox"><p>Code: </p><pre><code>&lt;?php$user = $_GET['user'];$gesamt = file_get_contents("bier_$user.txt");    if (in_array($_GET['user'], ['Thomas', 'h4'])) {echo "$user: Biere insgesamt: $gesamt"; die;}else{echo "Keine Berechtigung, Junge."; die; die; }?&gt;</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12817">Pauschi</a> — Wed Aug 12, 2020 8:27 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ComputerTech]]></name></author>
		<updated>2020-08-11T10:08:31-04:00</updated>

		<published>2020-08-11T10:08:31-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=108865#p108865</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=108865#p108865"/>
		<title type="html"><![CDATA[&quot;Visit&quot; URL with command .pizza]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=108865#p108865"><![CDATA[
Nice code CrazyCat <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_biggrin.gif" width="15" height="15" alt=":D" title="Very Happy"> <br><br>I like the way you did this<div class="codebox"><p>Code: </p><pre><code>if { ![isop $nick $chan] &amp;&amp; ![ishalfop $nick $chan] &amp;&amp; ![isvoice $nick $chan] } { return 1 }</code></pre></div>I will use that for my code from now on <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_biggrin.gif" width="15" height="15" alt=":D" title="Very Happy"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12849">ComputerTech</a> — Tue Aug 11, 2020 10:08 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[CrazyCat]]></name></author>
		<updated>2020-08-11T09:36:39-04:00</updated>

		<published>2020-08-11T09:36:39-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=108864#p108864</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=108864#p108864"/>
		<title type="html"><![CDATA[&quot;Visit&quot; URL with command .pizza]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=108864#p108864"><![CDATA[
You may try to understand the script and how it works.<br><strong class="text-strong">desturl</strong> is setted at the beginning, before the proc is called, so adding "user=$nick" is an error because there is no $nick variable setted yet.<br><br>In the proc, I create the query (things coming after the ? in url), so:<div class="codebox"><p>Code: </p><pre><code>set query [::http::formatQuery user $nick]set tok [::http::geturl $::desturl -query $query]</code></pre></div> will create:<br><a href="http://google.de/pizza.php?user=%3C$nick" class="postlink">http://google.de/pizza.php?user=&lt;$nick</a>&gt; (&lt;$nick&gt; is the user doing .pizza)<br><br>The interest of this is that if you have special characters in $nick, they will be adapted. And if you need to post rather than get, it's managed by the http call.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=691">CrazyCat</a> — Tue Aug 11, 2020 9:36 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Pauschi]]></name></author>
		<updated>2020-08-11T09:22:05-04:00</updated>

		<published>2020-08-11T09:22:05-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=108863#p108863</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=108863#p108863"/>
		<title type="html"><![CDATA[&quot;Visit&quot; URL with command .pizza]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=108863#p108863"><![CDATA[
<blockquote class="uncited"><div>Thanks ComputerTech.<br><br>@Pauschi: if you want to have it working for voice and ops (add halfop to), the final script is:<div class="codebox"><p>Code: </p><pre><code>bind pub - ".pizza" pizzameset desturl "http://google.de/pizza.php"package require httpproc pizzame {nick host handle chan text} {   if { ![isop $nick $chan] &amp;&amp; ![ishalfop $nick $chan] &amp;&amp; ![isvoice $nick $chan] } { return 1 }   set query [::http::formatQuery user $nick]   set tok [::http::geturl $::desturl -query $query]   set data [::http::data $tok]   putserv "PRIVMSG $chan :$data"}</code></pre></div><strong class="text-strong">Notice that it won't work with https url.</strong></div></blockquote>Thanks! Im using this script because i better skip the HTTPS thing, since its not working with the servers configuration (https force is on there).<br><br>However, i tried setting this URL =&gt;<br><br>set desturl "<a href="http://google.de/pizza.php%5Bb%5D?user=$nick" class="postlink">http://google.de/pizza.php[b]?user=$nick</a>[/b]"<br><br>its not using the $nick (IRC Nickname) with this way<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12817">Pauschi</a> — Tue Aug 11, 2020 9:22 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[CrazyCat]]></name></author>
		<updated>2020-08-11T03:44:44-04:00</updated>

		<published>2020-08-11T03:44:44-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=108862#p108862</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=108862#p108862"/>
		<title type="html"><![CDATA[&quot;Visit&quot; URL with command .pizza]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=108862#p108862"><![CDATA[
Sure there is a way <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><div class="codebox"><p>Code: </p><pre><code>bind pub - ".pizza" pizzameset desturl "http://google.de/pizza.php"package require httppackage require tlsproc pizzame {nick host handle chan text} {   if { ![isop $nick $chan] &amp;&amp; ![ishalfop $nick $chan] &amp;&amp; ![isvoice $nick $chan] } { return 1 }   if { [string match "https://*" $::desturl] } {      ::http::register https 443 [list ::tls::socket -autoservername true]      set https 1   } else {      set https 0   }   set query [::http::formatQuery user $nick]   set tok [::http::geturl $::desturl -query $query]   set data [::http::data $tok]   if { $https == 1 } { ::http::unregister https }   putserv "PRIVMSG $chan :$data"}</code></pre></div>I made the script adaptative to url scheme, but you can have troubles with tls handshake, depending on the url you want to access.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=691">CrazyCat</a> — Tue Aug 11, 2020 3:44 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Pauschi]]></name></author>
		<updated>2020-08-11T02:35:30-04:00</updated>

		<published>2020-08-11T02:35:30-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=108861#p108861</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=108861#p108861"/>
		<title type="html"><![CDATA[&quot;Visit&quot; URL with command .pizza]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=108861#p108861"><![CDATA[
Thank you guys, appreciate your work and help!<br><br>Ive just learned that https links sadly dont work.<br><br>Theres no way to avoid this?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12817">Pauschi</a> — Tue Aug 11, 2020 2:35 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[CrazyCat]]></name></author>
		<updated>2020-08-11T02:32:29-04:00</updated>

		<published>2020-08-11T02:32:29-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=108860#p108860</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=108860#p108860"/>
		<title type="html"><![CDATA[&quot;Visit&quot; URL with command .pizza]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=108860#p108860"><![CDATA[
Thanks ComputerTech.<br><br>@Pauschi: if you want to have it working for voice and ops (add halfop to), the final script is:<div class="codebox"><p>Code: </p><pre><code>bind pub - ".pizza" pizzameset desturl "http://google.de/pizza.php"package require httpproc pizzame {nick host handle chan text} {   if { ![isop $nick $chan] &amp;&amp; ![ishalfop $nick $chan] &amp;&amp; ![isvoice $nick $chan] } { return 1 }   set query [::http::formatQuery user $nick]   set tok [::http::geturl $::desturl -query $query]   set data [::http::data $tok]   putserv "PRIVMSG $chan :$data"}</code></pre></div><strong class="text-strong">Notice that it won't work with https url.</strong><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=691">CrazyCat</a> — Tue Aug 11, 2020 2:32 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ComputerTech]]></name></author>
		<updated>2020-08-10T22:17:39-04:00</updated>

		<published>2020-08-10T22:17:39-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=108859#p108859</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=108859#p108859"/>
		<title type="html"><![CDATA[&quot;Visit&quot; URL with command .pizza]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=108859#p108859"><![CDATA[
Like this  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"> <br><div class="codebox"><p>Code: </p><pre><code>bind pub - ".pizza" pizzame   package require http   proc pizzame {nick host handle chan text} {     if {![isop $nick $chan]} { return 1 }set tok [::http::geturl "http://google.de/pizza.php?user=$nick"]    set data [::http::data $tok]     putserv "PRIVMSG $chan :$data"    }</code></pre></div>when CrazyCat says procedure, he means basically the proc<br><div class="codebox"><p>Code: </p><pre><code>proc pizzame {nick host handle chan text} {    &lt;&lt; Proc</code></pre></div><blockquote class="uncited"><div>All OPS and VOICE users in the channel should be allowed to do it.<br><br><br>if {![isop $nick $chan]} { return 1 }<br><br><br>Where do i need to set this? ;P</div></blockquote>the above code will Only allow channel op's to use the command, there is also..<div class="codebox"><p>Code: </p><pre><code>if {![isvoice $nick $chan]} { return 1 }</code></pre></div>if you prefer that <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12849">ComputerTech</a> — Mon Aug 10, 2020 10:17 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Pauschi]]></name></author>
		<updated>2020-08-10T15:19:56-04:00</updated>

		<published>2020-08-10T15:19:56-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=108857#p108857</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=108857#p108857"/>
		<title type="html"><![CDATA[&quot;Visit&quot; URL with command .pizza]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=108857#p108857"><![CDATA[
All OPS and VOICE users in the channel should be allowed to do it.<br><br><br>if {![isop $nick $chan]} { return 1 }<br><br><br>Where do i need to set this? ;P<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12817">Pauschi</a> — Mon Aug 10, 2020 3:19 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[CrazyCat]]></name></author>
		<updated>2020-08-10T15:03:05-04:00</updated>

		<published>2020-08-10T15:03:05-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=108856#p108856</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=108856#p108856"/>
		<title type="html"><![CDATA[&quot;Visit&quot; URL with command .pizza]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=108856#p108856"><![CDATA[
It depends on what you mean when you say it must be triggered by operator.<br><br>If it's channel operator in the eggdrop' userlist, my bind was right.<br>If it's being opped in the channel, your bind is right but you have to add a check at the begin of the procedure:<div class="codebox"><p>Code: </p><pre><code>if {![isop $nick $chan]} { return 1 }</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=691">CrazyCat</a> — Mon Aug 10, 2020 3:03 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Pauschi]]></name></author>
		<updated>2020-08-10T12:15:40-04:00</updated>

		<published>2020-08-10T12:15:40-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=108855#p108855</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=108855#p108855"/>
		<title type="html"><![CDATA[&quot;Visit&quot; URL with command .pizza]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=108855#p108855"><![CDATA[
Thank you very much for answering.<br><br>I'll check it out and let you know if its working <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br><br>yeah it was a example URL <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br><br>EDIT: Somehow the bot is not responding :/<br><br>It worked with:<br><br>bind pub - ".pizza" pizzame<br><br>but not with<br><br>bind pub -|o ".pizza" pizzame<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12817">Pauschi</a> — Mon Aug 10, 2020 12:15 pm</p><hr />
]]></content>
	</entry>
	</feed>
