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 

!Chaninfo channel request [Solved]

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
Puck
Voice


Joined: 08 Mar 2008
Posts: 10
Location: Budapest, Hungary

PostPosted: Sun Mar 09, 2008 6:20 pm    Post subject: !Chaninfo channel request [Solved] Reply with quote

Hi everyone.

I searched the website, the archives and the forum, but i didnt manage too find a script that basicly does the following thing:

If i type .chaninfo in the channel the bot replies the channel settings in a pub message or notice, and i`d like this kind of script so that other channel owners can see theire channel settings without connecting too the partyline, and they, if its possible, can choose so that the reply comes in a notice or a pub message on the channel, and only +m +n or +o can benefit with this command, and if the user doesnt have these flags it replies them with "Sorry, access denied." Also another feature would be good, if the bot wouldnt selfflood its self, since im using allprotection.tcl, and it has a lot of settings in the chaninfo area (as you all know the script), so if it would be possible that after 150 chars it would do another line.

I`m very new in the TCL, looked thruw the forum and found lots of great scripts and used them, i juse want this script too give more freedom too the channel owners who use my egg.

Thank you in advance for the help.

P.S. : I didnt find a good avatar with a woman and here are the blushing and crying smilies : Crying or Very sad Embarassed

(This is the way too post a request right ? Razz)


Last edited by Puck on Wed Mar 12, 2008 5:40 am; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Sun Mar 09, 2008 6:37 pm    Post subject: Reply with quote

Code:
bind pub - .chaninfo show:chaninfo

proc show:chaninfo {nick uhost hand chan arg} {
 foreach info [channel info $chan] {
  puthelp "privmsg $chan :$info"
 }
}

_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
Puck
Voice


Joined: 08 Mar 2008
Posts: 10
Location: Budapest, Hungary

PostPosted: Mon Mar 10, 2008 3:26 am    Post subject: Reply with quote

Thank you for your reply Sir_Fz. The code works rather funny, the bot starts with the settings and pasts one on each line :

Quote:
[08:19] (@Akos0): +stn
[08:19] (@Akos0): 0
[08:19] (@Akos0): 0
[08:19] (@Akos0): 0
[08:20] (@Akos0): 10:2
[08:20] (@Akos0): 3:1
[08:20] (@Akos0): 5:3
[08:20] (@Akos0): 0:0
[08:20] (@Akos0): 3:1
[08:20] (@Akos0): 0:0
[08:20] (@Akos0): 5:30
[08:20] (@Akos0): 0
[08:20] (@Akos0): 60
[08:20] (@Akos0): 60
[08:20] (@Akos0): -enforcebans
[08:20] (@Akos0): +dynamicbans
[08:20] (@Akos0): +userbans
[08:20] (@Akos0): -autoop
[08:20] (@Akos0): -autohalfop
[08:20] (@Akos0): -bitch
[08:21] (@Akos0): +greet
[08:21] (@Akos0): +protectops
[08:21] (@Akos0): -protecthalfops
[08:21] (@Akos0): -protectfriends
[08:21] (@Akos0): +dontkickops
[08:21] (@Akos0): -inactive
[08:21] (@Akos0): +statuslog
[08:21] (@Akos0): -revenge
[08:21] (@Akos0): -revengebot
[08:21] (@Akos0): -secret
[08:21] (@Akos0): +shared
[08:21] (@Akos0): -autovoice
[08:21] (@Akos0): +cycle
[08:21] (@Akos0): -seen
[08:21] (@Akos0): +dynamicexempts
[08:21] (@Akos0): +userexempts
[08:21] (@Akos0): +dynamicinvites
[08:21] (@Akos0): +userinvites
[08:21] (@Akos0): -nodesynch
[08:21] (@Akos0): ap:level 100
[08:22] (@Akos0): ap:textl {5:1 60 k:kb 2}


And only at the end it pasts the allprotection`s settings, but this way the bot gets lagged, isnt there a way too make the bot paste the settings in 3 or 4 lines, one after the other, like this :

Quote:
ap:level 100, ap:textl {5:1 60 k:kb 2}, ap:textc {215:3 120 kb 2}, ap:notcl {2:1 120 kb 2}, ap:notcc {200:3 180 kb 2}, ap:caps {75:90 120 kb 2}, ap:repeatl {3:10 60 k:kb 2}


And so on Rolling Eyes
Back to top
View user's profile Send private message Visit poster's website
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Mon Mar 10, 2008 7:04 am    Post subject: Reply with quote

Could try something like this, prints 4 settings on each line:
Code:
bind pub - .chaninfo show:chaninfo

proc show:chaninfo {nick uhost hand chan arg} {
 foreach [list "info1" "info2" "info3" "info4"] [channel info $chan] {
  puthelp "privmsg $chan :$info1, $info2, $info3, $info4"
 }
}

One cosmetic issue is that it might print excessive commas (,) on the last line depending on the number of settings.
Labels for string and integer settings would have to be hardcoded however, as there is no mechanism to retrieve these easily through tcl-scripting.

Another way that might work more like you requested:
Code:
bind pub - .chaninfo show:chaninfo

proc show:chaninfo {nick uhost hand chan arg} {
 puthelp "PRIVMSG $chan :[join [channel info $chan] ", "]"
}

Keep in mind that the whole string of settings may become quite long, and need to be split over several lines through some cleaver mechanics.
_________________
NML_375, idling at #eggdrop@IrcNET
Back to top
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Mon Mar 10, 2008 12:38 pm    Post subject: Reply with quote

Try wordwrap
Code:
proc show:chaninfo {nick uhost hand chan arg} {
 foreach info [wordwrap [join [channel info $chan]] 100] {
  puthelp "privmsg $chan :$info"
 }
}

# user's wordwrap proc
proc wordwrap {str {len 70} {splitChr { }}} {
 set out [set cur {}]; set i 0
 foreach word [split [set str][unset str] $splitChr] {
  if {[incr i [string len $word]]>$len} {
   lappend out [join $cur $splitChr]
   set cur [list $word]
   set i [string len $word]
  } {
   lappend cur $word
  }
  incr i
 }
 lappend out [join $cur $splitChr]
}

_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
Puck
Voice


Joined: 08 Mar 2008
Posts: 10
Location: Budapest, Hungary

PostPosted: Wed Mar 12, 2008 5:40 am    Post subject: Reply with quote

Thank you Very Much. It works fine (:
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 -> Script Requests 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