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 

Changing part of topic with script?

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


Joined: 16 Aug 2006
Posts: 19

PostPosted: Mon Jun 17, 2013 6:29 am    Post subject: Changing part of topic with script? Reply with quote

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
View user's profile Send private message
heartbroken
Op


Joined: 23 Jun 2011
Posts: 106
Location: somewhere out there

PostPosted: Mon Jun 17, 2013 7:13 pm    Post subject: Reply with quote

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
View user's profile Send private message
ein7opf
Voice


Joined: 16 Aug 2006
Posts: 19

PostPosted: Tue Jun 18, 2013 4:17 pm    Post subject: Reply with quote

thanks a lot!! i will try this =) awesome Wink))
i have one question ...
Code:
$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
Back to top
View user's profile Send private message
caesar
Mint Rubber


Joined: 14 Oct 2001
Posts: 3741
Location: Mint Factory

PostPosted: Wed Jun 19, 2013 4:10 am    Post subject: Reply with quote

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
View user's profile Send private message
heartbroken
Op


Joined: 23 Jun 2011
Posts: 106
Location: somewhere out there

PostPosted: Wed Jun 19, 2013 4:51 am    Post subject: Reply with quote

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
View user's profile Send private message
ein7opf
Voice


Joined: 16 Aug 2006
Posts: 19

PostPosted: Wed Jun 19, 2013 6:23 am    Post subject: Reply with quote

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
View user's profile Send private message
ein7opf
Voice


Joined: 16 Aug 2006
Posts: 19

PostPosted: Wed Sep 25, 2013 5:35 pm    Post subject: Reply with quote

hi! me again Very Happy
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
View user's profile Send private message
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