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 

Trying to create a sop/vop/aop/akick list
Goto page 1, 2, 3, 4, 5  Next
 
Post new topic   This topic is locked: you cannot edit posts or make replies.    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
Sergios
Voice


Joined: 23 Jul 2004
Posts: 14

PostPosted: Fri Jul 23, 2004 2:55 pm    Post subject: Trying to create a sop/vop/aop/akick list Reply with quote

Hello, i'm trying to create a tcl to write the lists into a someone.txt file and then with a generate.tcl to an html file. My problem is that: i use putquick "PRIVMSG chanserv :sop $arg list" where $arg is #channel. The problem is that it execute the command but how can the result of this command write it to a file? i have try this but it fails :
set file [open $::cfile a]
puts $file "Channel Access List: ^B$arg^B"
putquick "PRIVMSG chanserv :sop $arg list"
close $file

Any help? Thanks
Back to top
View user's profile Send private message
DayCuts
Voice


Joined: 15 Jun 2004
Posts: 37

PostPosted: Fri Jul 23, 2004 11:26 pm    Post subject: Reply with quote

Code:
puts $file "Channel Access List: ^B $arg ^B"
Back to top
View user's profile Send private message
Sergios
Voice


Joined: 23 Jul 2004
Posts: 14

PostPosted: Sat Jul 24, 2004 12:18 am    Post subject: Reply with quote

With puts $file "Channel Access List: ^B $arg ^B" i don't get the sop list of channel that i want ($arg=channel). I really want the text of the command that gives this command : putquick "PRIVMSG chanserv :sop $arg list" , so that can write into acc.txt the access list of #mychannel via chanserv command. Any help?
Back to top
View user's profile Send private message
Alchera
Revered One


Joined: 11 Aug 2003
Posts: 3344
Location: Ballarat Victoria, Australia

PostPosted: Sat Jul 24, 2004 3:26 am    Post subject: Reply with quote

Is this what you're after?
Code:

putserv "PRIVMSG ChanServ@services.dal.net :SOP $arg LIST

With the above format one can use all services commands as you would in mIRC etc. Smile
_________________
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
Back to top
View user's profile Send private message Visit poster's website
Sergios
Voice


Joined: 23 Jul 2004
Posts: 14

PostPosted: Sat Jul 24, 2004 7:21 am    Post subject: Reply with quote

Well,yes, i know that is the command. That i want is that command you tell to write it to a file. I mean the result of the command(of chanserv), the SOP list is:1)Sergios sergios@something.net
2)Nickname userid@host
I mean the sop list how can i write it to a file?
Any help?
Back to top
View user's profile Send private message
awyeah
Revered One


Joined: 26 Apr 2004
Posts: 1580
Location: Switzerland

PostPosted: Mon Jul 26, 2004 9:43 pm    Post subject: Reply with quote

Okay lets see, show me a sample output of one of your chanserv list notices. So we can go ahead and do a string match, then write all of the text to a file.
_________________
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
Sergios
Voice


Joined: 23 Jul 2004
Posts: 14

PostPosted: Tue Jul 27, 2004 3:07 am    Post subject: Reply with quote

Ok, let me give the script that it coded
Code:

##
# DCsoplist2txt.tcl by DrugCheese for sergios
#  7-24-04
#
#    Will write chanservs SOp list for a channel to filesystem
##

# Set the file name, the time of day , and the channel
bind msg n DCtest DCtest
proc DCtest {nick host hand arg} { WriteList 1 2 3 4 5 }
#set the filename to save to
#set SOpList "SOplist.txt"
set qfile soplist.txt
#set the time of day  ( 1:05am )
bind time - "05 01 * * *" WriteList

#set the channel to check
set Channel "#parea"

#################################################

proc WriteList {mi ho dd mo ye} {
                global Channel
                        putlog "DCsoplist2txt - sending request to chanserv"
                                putquick "chanserv :sop $Channel list"
                        }
#       bind notc -|- ** IncomingNotice
proc IncomingNotice {nick host hand arg dest} {
#                       putlog "incoming NOTICE nick $nick $host host hand $hand arg $arg dest $dest"
                        global Channel
                        if {$nick != "ChanServ"} {
                        return 0
        }
               if {[string match *$Channel* $arg]} {
        set file [open $::qfile w]
        puts $file "$arg"
        close $file
          putlog "DCsoplist2txt - retrieved and written"
          return 0
          }
}
                putlog "DCsoplist2txt loaded"


And now i will give you the sop list from chanserv,my chanserv is chanserv!services@irc.net
and the sop list is:
Code:

<10:01am> -ChanServ- SOP list for #parea:
-
<10:01am> -ChanServ-  * 1) TheKeyMaster (~TKM@patra-nirvana-273AAAFA.parea.pwn) (added by Sergios  via: Sergios - (nirvana.netadmin.net) - Sun Feb 22 01:13:32 2004 EST)
-
<10:01am> -ChanServ-  * 2) Jasonpap (fghj@patra-nirvana-F4B0DA7.parea.pwn) (added by Sergios via: Sergios - (nirvana.netadmin.net) - Wed Jan 07 22:29:00 2004 EST)
-
<10:01am> -ChanServ-  * 3) Eirhnh (~Eirhnh@admin.nirvana.net) (added by Sergios via: Sergios - (nirvana.netadmin.net) - Wed Jan 07 22:53:21 2004 EST)
-
<10:01am> -ChanServ- End of List.
-
<10:01am> -ChanServ- Nicks with the aprotect setting enabled are bold and are marked with a '*'. If an access mask has been set for an entry, the mask is also being printed in bold letters.

I dont use the dalnet ircservices, kickservices from kickchat.
If you can help me to edit the script. Now it write only the first line, and i mean this :SOP list for #parea:
Thanks for the reply and sorry for my wrong place which i was posting yesterday.
Back to top
View user's profile Send private message
awyeah
Revered One


Joined: 26 Apr 2004
Posts: 1580
Location: Switzerland

PostPosted: Tue Jul 27, 2004 3:36 am    Post subject: Reply with quote

Okay, lets scrap... (discard) the one you wrote.
I'll write a fresh one right here, right now. Razz

Code:

#Set the filename to save the access list records in.
set accesslist "accesslist.txt"

if {![file exists $accesslist]} {
 putlog "ACCESS LIST FILE:\002 $accesslist \002file \002does not exist\002, *creating file*: \002$accesslist\002"
 set file [open $accesslist "w"]
 puts $file "-ChanServ Access List Records-\n"
 close $file
}

bind msgm n !chanserv get:access:list
bind notc - save:access:list

proc get:access:list {nick uhost hand text} {
 set type [lindex $text 0]; set chan [lindex $text 1]
 if {([string equal -nocase "list" [lindex $text 2]])} {
 putquick "PRIVMSG chanserv :$type $chan list"
 }
}

proc save:access:list {nick uhost hand text {dest ""}} {
 global botnick accesslist
  if {(![string equal -nocase $botnick $dest]) || ([string match -nocase "#*" $dest])} { return 0 }
  if {([string equal $nick "ChanServ"]) && ([string equal $uhost "services@irc.net"])} {
  if {(([string match "*)" [lindex $text 1]]) && ([string match "(*@*)" [lindex $text 3]]) &&  ([string equal "(added" [lindex $text 4]]) && ([string equal "by" [lindex $text 5]])) ||  (([string match "*?OP list for*" $text]) || ([string equal "End of List" $text]))} {
  if {![file exists $accesslist]} { set file [open $accesslist "w"]; puts $file "-ChanServ Access List Records-\n"; close $file }
  set file [open $accesslist "a"]; puts $file $text; close $file
  return 0
  }
 }
}


Quote:

Usage: /msg <botnick> !chanserv <AOP|SOP|AKICK> <#channel> list


Okay, I haven't tested this so.. I am not sure. But something like this should definately work, with the output of your chanserv's access list. Wink

There might be a few syntax errors, because I wrote this in a hurry! Mr. Green
_________________
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
Sergios
Voice


Joined: 23 Jul 2004
Posts: 14

PostPosted: Tue Jul 27, 2004 9:02 am    Post subject: Reply with quote

It continuous have the problem.
when i do
Quote:
/msg eirhnh !chanserv sop #parea list

and i open the file i see this part
Code:
-ChanServ Access List Records-
Back to top
View user's profile Send private message
Alchera
Revered One


Joined: 11 Aug 2003
Posts: 3344
Location: Ballarat Victoria, Australia

PostPosted: Tue Jul 27, 2004 10:20 am    Post subject: Re:Trying to create a sop/vop/aop/akick list Reply with quote

This could have application in other areas also awyeah. You might be able to solve a long standing problem of mine. Very Happy
_________________
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
Back to top
View user's profile Send private message Visit poster's website
awyeah
Revered One


Joined: 26 Apr 2004
Posts: 1580
Location: Switzerland

PostPosted: Tue Jul 27, 2004 12:25 pm    Post subject: Reply with quote

/me confused *Alchera* didn't get what you wanted to say.

As for you sergios, try using putlog, some of the string matching conditions or maybe anyone is not coming true, for which it is not executing it. Cool

Maybe you can reduce the number of matches. Wink
I've used these types of scripts alot of places, and they've worked
for me, you just have to give them a bit of time and a bit of test. Rolling Eyes
_________________
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
Alchera
Revered One


Joined: 11 Aug 2003
Posts: 3344
Location: Ballarat Victoria, Australia

PostPosted: Tue Jul 27, 2004 12:48 pm    Post subject: Reply with quote

awyeah: verifying that a nick is registered with services via a match with a channel's access list. Using a public commands script the bot could check that the nick being added as a user is actually registered; if not, the bot refuses to add the user to its' user file. Smile
_________________
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
Back to top
View user's profile Send private message Visit poster's website
Alchera
Revered One


Joined: 11 Aug 2003
Posts: 3344
Location: Ballarat Victoria, Australia

PostPosted: Tue Jul 27, 2004 11:19 pm    Post subject: Reply with quote

I had a "fiddle" with your script also awyeah and the variable "$text" contains no information. The end result is a text file with just "-ChanServ Access List Records-" on the first line followed by 2 empty lines; putlog bore no fruit either!
_________________
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
Back to top
View user's profile Send private message Visit poster's website
awyeah
Revered One


Joined: 26 Apr 2004
Posts: 1580
Location: Switzerland

PostPosted: Tue Jul 27, 2004 11:44 pm    Post subject: Reply with quote

The $text variable, should contain the notice sent by chanserv. The procedure is binded on notice, so the $text should be the message. That is very simple logic. Mr. Green

Check it, after this line:

Code:

  if {(![string equal -nocase $botnick $dest]) || ([string match -nocase "#*" $dest])} { return 0 }


Put this:

Code:

putlog "$text"


It should definately give an output for the variable $text and will indeed not be null. Wink
_________________
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
Alchera
Revered One


Joined: 11 Aug 2003
Posts: 3344
Location: Ballarat Victoria, Australia

PostPosted: Wed Jul 28, 2004 12:29 am    Post subject: Reply with quote

My nick it did. LOL

Maybe paste a DALnet version of it .. might make it simpler. Very Happy
_________________
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   This topic is locked: you cannot edit posts or make replies.    egghelp.org community Forum Index -> Scripting Help All times are GMT - 4 Hours
Goto page 1, 2, 3, 4, 5  Next
Page 1 of 5

 
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