egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Anyone already use picoirc package ?

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
CrazyCat
Owner


Joined: 13 Jan 2002
Posts: 973
Location: France

PostPosted: Wed May 25, 2022 5:59 am    Post subject: Anyone already use picoirc package ? Reply with quote

Hi there,

I'm trying to use picoirc but I can't have any result.
I probably misunderstood how it works, so if anyone knows...

My (actual) try:
Code:
package require picoirc

proc test {} {
   set myirc [::picoirc::connect cbirc testor "irc://irc.zeolia.net/test"]
}

proc cbirc {context state args} {
   puts "Callback is here with $args"
   switch $state {
      init {
         puts "Initialized with $context"
      }
      connect {
         puts "connected ?"
         ::picoirc::post $context "/join #test2"
      }
      close {
         puts "Well, close with $args"
      }
      debug {
         puts "D --> $args"
      }
      default {
         puts $state
         }
     }
}


And when using:
Code:
crazycat@dev:~$ tclsh
% source ircclient.tcl
% test
Callback is here with
Initialized with ::picoirc::irc1
::picoirc::irc1


And nothing appear in IRC, neither in my ircd logs...
_________________
https://www.eggdrop.fr
Offer me a coffee - Do not ask me help in PM, we are a community.
Back to top
View user's profile Send private message Visit poster's website
CrazyCat
Owner


Joined: 13 Jan 2002
Posts: 973
Location: France

PostPosted: Wed May 25, 2022 7:37 am    Post subject: Reply with quote

Ok, here is the answer
Quote:
13:23:35 <mjanssen> CrazyCat: your eventloop is not running
13:23:54 <mjanssen> instead of directly calling test do after 10 test ; vwait forever
13:24:17 <CrazyCat> mjanssen> oh ? let me try that
13:24:18 <mjanssen> after 10 test ; will schedule the call to test as soon as the eventloop starts running
13:24:29 <mjanssen> vwait forever ; will start the event loop
13:26:34 <CrazyCat> oh yes it works !

_________________
https://www.eggdrop.fr
Offer me a coffee - Do not ask me help in PM, we are a community.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber