This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Changing part of topic with script?

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
e
ein7opf
Voice
Posts: 19
Joined: Wed Aug 16, 2006 9:28 am

Changing part of topic with script?

Post by ein7opf »

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: Select all

/msg Q SETTOPIC ...
at the moment the code for the topic is:

Code: Select all

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 =)
User avatar
heartbroken
Op
Posts: 110
Joined: Thu Jun 23, 2011 11:15 pm
Location: somewhere out there

Post by heartbroken »

Code: Select all

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
e
ein7opf
Voice
Posts: 19
Joined: Wed Aug 16, 2006 9:28 am

Post by ein7opf »

thanks a lot!! i will try this =) awesome ;)))
i have one question ...

Code: Select all

$x
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
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Code: Select all

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.
Last edited by caesar on Wed Jun 19, 2013 5:52 am, edited 1 time in total.
Once the game is over, the king and the pawn go back in the same box.
User avatar
heartbroken
Op
Posts: 110
Joined: Thu Jun 23, 2011 11:15 pm
Location: somewhere out there

Post by heartbroken »

fixed...
Last edited by heartbroken on Wed Jun 19, 2013 1:38 pm, edited 1 time in total.
Life iS Just a dReaM oN tHE wAy to DeaTh
e
ein7opf
Voice
Posts: 19
Joined: Wed Aug 16, 2006 9:28 am

Post by ein7opf »

this is awesome! thanks a lot heartbroken and caesar =)

it works. i added the #chan in

Code: Select all

puthelp "PRIVMSG Q :SETTOPIC $topic" 
now everything is fine!

this is great. Thank you very much!

ein7opf
e
ein7opf
Voice
Posts: 19
Joined: Wed Aug 16, 2006 9:28 am

Post by ein7opf »

hi! me again :D
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° -///
Post Reply