| View previous topic :: View next topic |
| Author |
Message |
ein7opf Voice
Joined: 16 Aug 2006 Posts: 19
|
Posted: Mon Jun 17, 2013 6:29 am Post subject: Changing part of topic with script? |
|
|
Hi @ alll =)
I am searching for a script that changes a part of the topic.
In the topic are users with a number of svs. This number changes frequently.
the command should be !svs number. for example: !svs 3500.
The Eggdrop should change the part of the topic where it finds the nick.
for example:
topic:
Scanner: Mili > FakeNick 5000, PowerMan 3555 | News > ein7opf 7000
when i say !svs 8000 in the chan, the eggdrop should change topic to:
Scanner: Mili > FakeNick 5000, PowerMan 3555 | News > ein7opf 8000
Chan and eggdrop are @ QuakeNet. So i think it should work with:
| Code: | | /msg Q SETTOPIC ... |
at the moment the code for the topic is:
| Code: | | 15,14\1,14\14,1\1,1-0,1 °o° Interner Chan | Scanner: 4,1Mili > FakeNick1, PowerMan0,1 | 3,1News > ein7opf0,1 | !bot für Botbefehle °o° 1,1-14,1/1,14/15,14/ |
i hope someone can help me =) |
|
| Back to top |
|
 |
heartbroken Op

Joined: 23 Jun 2011 Posts: 106 Location: somewhere out there
|
Posted: Mon Jun 17, 2013 7:13 pm Post subject: |
|
|
| Code: | setudef flag tpchan
bind pub n !svs tpc_pub
proc tpc_pub {nick uhost hand chan text} {
if {![channel get $chan tpchan]} {
return 0
}
set x [lindex [split $text] 0]
set y {\\\°o° Interner Chan | Scanner: Mili > FakeNick1, PowerMan0,1 | News > ein7opf $x | !bot für Botbefehle °o° -///}
putserv "privmsg Q :settopic $y"
} |
set your channel on partyline with:
.chanset #your-channel +tpchan
to colorize your topic (you can add colour codes in set y {line} ) :-> http://forum.egghelp.org/viewtopic.php?t=3867 _________________ Life iS Just a dReaM oN tHE wAy to DeaTh |
|
| Back to top |
|
 |
ein7opf Voice
Joined: 16 Aug 2006 Posts: 19
|
Posted: Tue Jun 18, 2013 4:17 pm Post subject: |
|
|
thanks a lot!! i will try this =) awesome ))
i have one question ... is only behind my nick. has this to be modified? the topic is an example. so fakenick and powerman should be abled to update their svs too.
thanks a lot again.
greetz .... ein7opf |
|
| Back to top |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3741 Location: Mint Factory
|
Posted: Wed Jun 19, 2013 4:10 am Post subject: |
|
|
| Code: |
bind pub * !svs pub:svs
proc pub:svs {nick uhost hand chan text} {
if {[scan $text {%d} number] !=1} {
puthelp "NOTICE $nick :Usage: !svs <number>"
return
}
set topic [topic $chan]
set pos [lsearch -nocase $topic $nick]
if {$pos != -1} {
incr pos
set topic [lreplace $topic $pos $pos $number]
puthelp "PRIVMSG Q :SETTOPIC $topic"
} else {
puthelp "NOTICE $nick :Sorry $nick, couldn't find you in the topic."
}
}
|
Haven't tested but should be what you asked for in the first place.
PS: You will need TCL 8.5 or above, else the lsearch will bitch about -nocase option.
Edit: Fixed typo. _________________ Once the game is over, the king and the pawn go back in the same box.
Last edited by caesar on Wed Jun 19, 2013 5:52 am; edited 1 time in total |
|
| Back to top |
|
 |
heartbroken Op

Joined: 23 Jun 2011 Posts: 106 Location: somewhere out there
|
Posted: Wed Jun 19, 2013 4:51 am Post subject: |
|
|
fixed... _________________ Life iS Just a dReaM oN tHE wAy to DeaTh
Last edited by heartbroken on Wed Jun 19, 2013 1:38 pm; edited 1 time in total |
|
| Back to top |
|
 |
ein7opf Voice
Joined: 16 Aug 2006 Posts: 19
|
Posted: Wed Jun 19, 2013 6:23 am Post subject: |
|
|
this is awesome! thanks a lot heartbroken and caesar =)
it works. i added the #chan in | Code: | | puthelp "PRIVMSG Q :SETTOPIC $topic" |
now everything is fine!
this is great. Thank you very much!
ein7opf |
|
| Back to top |
|
 |
ein7opf Voice
Joined: 16 Aug 2006 Posts: 19
|
Posted: Wed Sep 25, 2013 5:35 pm Post subject: |
|
|
hi! me again
the script works nice!
but now i have a few new users.
is there a way, that the new users can add thereselfs?
something like !scanner news or mili svsnumber
for example: !scanner news 1569
or
!scanner mili 5890
the script should write the nick an svs on the right side in the topic (news or mili)
topic looks like this:
\\\°o° Interner Chan | Scanner: Mili > FakeNick 1500, PowerMan 9800 | News > ein7opf 7000 °o° -/// |
|
| Back to top |
|
 |
|