|
Joined: Oct 2005
Posts: 75
Babel fish
|
OP
Babel fish
Joined: Oct 2005
Posts: 75 |
your code don't work i used same one you post
on *:JOIN:#:{ if ($nick == $me) { %topic $+ chan = $chan(#).topic } }
on *:TOPIC:#:{ if ($nick == $me) { timer 1 3 /set %topic $+ chan $chan(#).topic | halt } else { topic # %topic $+ chan } }
and it gave me this,
MyBotNick changes topic to "4¡!¹'¹!7¡!¹'¹!8¡!¹'¹!9¡!¹'¹!12¡!¹'¹!13¡!¹'¹! what goes around comes around 13!¹'¹!¡12!¹'¹!¡9!¹'¹!¡8!¹'¹!¡7!¹'¹!¡4!" MeTheOwner changes topic to "welcome to my channel" MyBotNick changes topic to "chan"
is the "%topic $+ chan" really necessary or you forgot to put the "$" before the "chan" ?
|
|
|
|
Joined: Oct 2005
Posts: 75
Babel fish
|
OP
Babel fish
Joined: Oct 2005
Posts: 75 |
still not helped....and confused like always
i asked help on topic lock on mirc but then you guys went on user level or prefixes etc...
|
|
|
|
Joined: Dec 2002
Posts: 3,547
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 3,547 |
Here's one way...
On *:Start: {
hmake topiclock 10
if ($exists(topiclock.hsh)) hload -i topiclock topiclock.hsh
}
alias ut {
if ($hfind(topiclock,$active)) hadd topiclock $active $iif($active ischan,$chan($chan).topic)
}
dialog topiclock {
title "Topic Lock"
size -1 -1 109 143
option dbu
combo 1, 4 4 102 107, size
button "Add", 2, 24 113 27 9
button "Rem", 3, 56 113 27 9
button "Close", 4, 37 127 37 12, ok
}
On *:Dialog:topiclock:init:*: {
var %x = 1
while (%x <= $hget($dname,0).item) {
did -a $dname 1 $hget($dname,%x).item
inc %x
}
}
On *:Dialog:topiclock:sclick:*: {
if ($did($dname,1)) {
if (!$hget(topiclock)) hmake topiclock 10
if ($did == 2) {
if (!$hfind($dname,$did($dname,1))) {
hadd $dname $did(1)
did -a $dname 1 $did(1)
}
}
elseif ($did == 3) {
if ($hfind($dname,$did($dname,1).seltext)) {
hdel $dname $did($dname,1).seltext
did -d $dname 1 $did($dname,1).sel
}
}
}
}
Raw 332:*: {
echo -s $2
if ($hfind(topiclock,$2)) hadd topiclock $2 $3-
hsave -i topiclock topiclock.hsh
}
On @*:Topic:#: {
if (($nick != $me) && ($hfind(topiclock,$chan))) {
topic $chan $hfind(topiclock,$chan)
}
}
It's channel specific so it should work in the channels you join. 1. Add a channel. 2. Join that channel (wont work if no topic is set). 3. Allow someone to change topic. 4. Topic is set back to the topic when you first joined. Notes: /tl - opens control panel /ut - stores the current topic in the table (updates) You will only change topic back if you are an op on the channel. **Untested** -Andy
|
|
|
|
Joined: Oct 2005
Posts: 75
Babel fish
|
OP
Babel fish
Joined: Oct 2005
Posts: 75 |
there's no alias for "tl" i tried typing /topiclock too but don't work it kept on saying error unknown command
and when ever i join a channel that i have op status in it echos this everytime i joined a channel #lobby if ($hfind(topiclock,$2)) hadd topiclock "#lobby welcome to myroom" exclude the channel name and "#lobby welcoem to myroom"
|
|
|
|
Joined: Dec 2002
Posts: 3,547
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 3,547 |
Ya, my apologies dude sorry it was about 4 am when I wrote that code and I was extremely tuckered out.. The /echo is my way of working with Raw's so I know before hand what is being sent to me. It seems I didn't post the updated code to allow "/tl"..
On *:Start: {
hmake topiclock 10
if ($exists(topiclock.hsh)) hload -i topiclock topiclock.hsh
}
alias ut {
if ($hfind(topiclock,$active)) hadd topiclock $active $iif($active ischan,$chan($chan).topic)
}
alias tl {
if (!$dialog(topiclock)) dialog -mo topiclock topiclock
}
dialog topiclock {
title "Topic Lock"
size -1 -1 109 143
option dbu
combo 1, 4 4 102 107, size
button "Add", 2, 24 113 27 9
button "Rem", 3, 56 113 27 9
button "Close", 4, 37 127 37 12, ok
}
On *:Dialog:topiclock:init:*: {
var %x = 1
while (%x <= $hget($dname,0).item) {
did -a $dname 1 $hget($dname,%x).item
inc %x
}
}
On *:Dialog:topiclock:sclick:*: {
if ($did($dname,1)) {
if (!$hget(topiclock)) hmake topiclock 10
if ($did == 2) {
if (!$hfind($dname,$did($dname,1))) {
hadd $dname $did(1)
did -a $dname 1 $did(1)
}
}
elseif ($did == 3) {
if ($hfind($dname,$did($dname,1).seltext)) {
hdel $dname $did($dname,1).seltext
did -d $dname 1 $did($dname,1).sel
}
}
}
hsave -i topiclock topiclock.hsh
}
Raw 332:*: {
if ($hfind(topiclock,$2)) hadd topiclock $2 $3-
hsave -i topiclock topiclock.hsh
}
On @*:Topic:#: {
if (($nick != $me) && ($hfind(topiclock,$chan))) {
topic $chan $hfind(topiclock,$chan)
hsave -i topiclock topiclock.hsh
}
}
-Andy
|
|
|
|
Joined: Oct 2005
Posts: 75
Babel fish
|
OP
Babel fish
Joined: Oct 2005
Posts: 75 |
ok now it looks like it's working but,
it's not doing what it suppose to do, i did what you stated in your instructions add channel and allow other op to change topic well this is how it came out when i put the code in my bot and i tried to change the topic myself. this is what it did.
[01:16a] * MyNick changes topic to 'welcome to my channel' [01:16a] * MyBot changes topic to '#lobby' <<-- my channel name i put in dialog where it says add and remove [01:16a] * MyNick changes topic to 'welcome to my channel' [01:16a] * MyBot changes topic to '#testing' <<-- did the same thing again
it kept on changing the topic back to the name of the channel i added instead of changing the topic back to previous topic i even close mirc and reopen and tried again but still the same
|
|
|
|
Joined: Dec 2002
Posts: 3,547
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 3,547 |
Another mistake...
Change topic $chan $hfind(topiclock,$chan) to topic $chan $hget(topiclock,$chan)
-Andy
|
|
|
|
Joined: Oct 2005
Posts: 75
Babel fish
|
OP
Babel fish
Joined: Oct 2005
Posts: 75 |
thank you much slade,
now it works perfect just the way it should work
one more question on your topic lock,
if i want to let others change topic without my bot changing it back to original topic, say a list of friends or certain people with a certain level for them to change the topic without my bot changing it back on the topic locker how do i do it on your topic locker?
|
|
|
|
Joined: Dec 2002
Posts: 3,547
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 3,547 |
On *:Start: {
hmake topiclock 10 | hmake topiclock_friends 10
if ($exists(topiclock.hsh)) hload -i topiclock topiclock.hsh
if ($exists(topiclock_friends.hsh)) hload -i topiclock_friends topiclock_friends.hsh
}
alias ut { if ($hfind(topiclock,$active)) hadd topiclock $active $iif($active ischan,$chan($chan).topic) }
alias tl { if (!$dialog(topiclock)) dialog -mo topiclock topiclock }
dialog topiclock_friends {
title "Topic Lock - Friends List"
size -1 -1 109 143
option dbu
combo 1, 4 4 102 107, size
button "Add", 2, 24 113 27 9
button "Rem", 3, 56 113 27 9
button "Close", 4, 37 127 37 12, ok
}
On *:Dialog:topiclock_friends:init:*: {
var %x = 1
while (%x <= $hget($dname,0).item) {
did -a $dname 1 $hget($dname,%x).item
inc %x
}
}
On *:Dialog:topiclock_friends:sclick:*: {
if ($did($dname,1)) {
if (!$hget($dname)) hmake $dname 10
if ($did == 2) {
if (!$hfind($dname,$did($dname,1))) {
hadd $dname $did(1) $did(1)
did -a $dname 1 $did(1)
}
}
elseif ($did == 3) {
if ($hfind($dname,$did($dname,1).seltext)) {
hdel $dname $did($dname,1).seltext
did -d $dname 1 $did($dname,1).sel
}
}
}
hsave -i $dname $+($dname,.hsh)
}
dialog topiclock {
title "Topic Lock"
size -1 -1 109 143
option dbu
combo 1, 4 4 102 107, size
button "Add", 2, 24 113 27 9
button "Rem", 3, 56 113 27 9
button "Friends",4, 80 129 27 9
button "Close", 5, 37 127 37 12, ok
}
On *:Dialog:topiclock:init:*: {
var %x = 1
while (%x <= $hget($dname,0).item) {
did -a $dname 1 $hget($dname,%x).item
inc %x
}
}
On *:Dialog:topiclock:sclick:*: {
if ($did($dname,1)) {
if (!$hget(topiclock)) hmake topiclock 10
if ($did == 2) {
if (!$hfind($dname,$did($dname,1))) {
hadd $dname $did(1)
did -a $dname 1 $did(1)
}
}
elseif ($did == 3) {
if ($hfind($dname,$did($dname,1).seltext)) {
hdel $dname $did($dname,1).seltext
did -d $dname 1 $did($dname,1).sel
}
}
else {
dialog -dm topiclock_friends topiclock_friends
}
}
if ($did == 4) dialog -mo topiclock_friends topiclock_friends
hsave -i topiclock topiclock.hsh
}
Raw 332:*: {
if ($hfind(topiclock,$2)) hadd topiclock $2 $3-
hsave -i topiclock topiclock.hsh
}
On @*:Topic:#: {
if (($nick != $me) && (!$hfind(topiclock_friends,$nick))) {
topic $chan $hget(topiclock,$chan)
hsave -i topiclock topiclock.hsh
}
}
If you type /tl you'll see there's an extra button for Friends list. -Andy
|
|
|
|
Joined: Oct 2005
Posts: 75
Babel fish
|
OP
Babel fish
Joined: Oct 2005
Posts: 75 |
once again thank you greatly slade it just keep on getting better and better thank you so much for your huge help
|
|
|
|
Joined: Dec 2002
Posts: 3,547
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 3,547 |
It seems I forgot to add a check to see if the item existed in the hash table..
On @*:Topic:#: {
if (($nick != $me) && (!$hfind(topiclock_friends,$nick))) {
if ($hfind(topiclock,$chan)) {
topic $chan $hget(topiclock,$chan)
hsave -i topiclock topiclock.hsh
}
}
}
And you're welcome.
|
|
|
|
|