|
Joined: Jul 2005
Posts: 29
Ameglian cow
|
OP
Ameglian cow
Joined: Jul 2005
Posts: 29 |
Intention: when pm arrives, send response based on channel status. Ops/Voices get "if" msg, others get the "else". My code is broke... it sends the else msg to Ops/Voices and Others. How can I fix it.
on ^*:open:?:*: {
if ($nick isop $chan) || ($nick isvoice $chan) { msg $nick sup7 $nick }
else {
msg $nick Do not pm me, didnt you read the topic?
}
}
Whats life without a little Karma? maddkarma[dot]com
|
|
|
|
Joined: Dec 2002
Posts: 3,547
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 3,547 |
$chan wont have a value (I don't think), as it's coming from a Private Message.
You could very well do:
if ($nick isop #ChannelName) { ... }
-Andy
|
|
|
|
Joined: Jul 2005
Posts: 29
Ameglian cow
|
OP
Ameglian cow
Joined: Jul 2005
Posts: 29 |
$chan wont have a value (I don't think), as it's coming from a Private Message.
You could very well do:
if ($nick isop #ChannelName) { ... }
-Andy Great Andy, works beautifully., Good looking out. Another thing.. Trying to stop and start it manually. where am I going wrong
alias queryfilter {
if ($1 == on) { .enable #queryrep | amsg starting query filter }
if ($1 == off) { .disable #queryrep | amsg stopping query filter }
}
#queryfilter on
on ^*:open:?:*: {
if ($nick isop #channel name) || ($nick isvoice #channel name) { msg $nick sup7 $nick }
else {
msg $nick Do not pm me didnt you read the topic?
}
}
Whats life without a little Karma? maddkarma[dot]com
|
|
|
|
Joined: Dec 2002
Posts: 3,547
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 3,547 |
Hey dude, slight alteration to you code.
alias queryfilter {
$iif($group(#queryfilter) == off,.enable,.disable) #queryfilter
$iif($group(#queryfilter) == off,amsg stopping query filter, amsg starting query filter)
}
#queryfilter off
on ^*:open:?:*: {
if ($nick isop #channel name) || ($nick isvoice #channelname) { msg $nick sup7 $nick }
else {
msg $nick Do not pm me didnt you read the topic?
}
}
#queryfilter end
Just simple type: /queryfilter If it's turned on, it turns it off. If it's turned off, it turns on. You wont need to keep typing /queryfilter on and /queryfilter off. -Andy
|
|
|
|
Joined: Jul 2005
Posts: 29
Ameglian cow
|
OP
Ameglian cow
Joined: Jul 2005
Posts: 29 |
Most decent!! Sheer genius. Great work SladeKraven (aka Andy)
Whats life without a little Karma? maddkarma[dot]com
|
|
|
|
Joined: Dec 2002
Posts: 3,547
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 3,547 |
Have a good one buddy, if you find any problems with the code or need help again all of us here try our best to help. -Andy
|
|
|
|
Joined: Jul 2005
Posts: 29
Ameglian cow
|
OP
Ameglian cow
Joined: Jul 2005
Posts: 29 |
I made additions to the code originally posted. I added a hash table to store ip address and a numeral for a person whom pm'ed me, if it was the first pm they'll get a warning, if the second they get kicked/ban. The script appears to work perfectly, though I'm stuck on trying to expand on it further. I wish to: increment the number of times a user pms me kick/ban dependent on number of times settable by me kick/ban for a span of time. 1min to Infinity read from text file for nics that are not Ops or Voices but are approved to pm me Any direction you could provide would be invaluable. I thank you for your indulgence. Raja Bahm *************** updated coding ***************
on *:start: {
hmake qcount 10
}
alias queryfilter {
$iif($group(#queryfilter) == off,.enable,.disable) #queryfilter
$iif($group(#queryfilter) == off,notice stopping query filter, notice starting query filter)
}
#queryfilter off
on ^*:open:?:*: {
if ($nick isop #ftres) || ($nick isvoice #ftres) { msg $nick sup7 $nick }
elseif ($me isop #ftres) && ($hget(qcount,$address($nick,2))) {
.kick #ftres $nick Couldnt read... could ya.
mode #ftres +b $address($nick,2)
}
else {
hadd -m qcount $address($nick,2) 1
msg $nick Don't msg ops/voices without permission. Repeat violators will be 4kicked/banned.
timer -m 1 4000 msg $nick Did you get that?
}
}
#queryfilter end
on *:EXIT: {
hsave -o qcount qcount.hsh
hfree qcount
}
Whats life without a little Karma? maddkarma[dot]com
|
|
|
|
Joined: Aug 2004
Posts: 7,252
Hoopy frood
|
Hoopy frood
Joined: Aug 2004
Posts: 7,252 |
Give this a try...got a few extra things in as well on *:start: {
hmake qcount 10
if $exists(qcount.hsh) { .hload qcount qcount.hsh }
}
alias queryfilter {
if (!$1) || ($1 != $group(#queryfilter).status) {
$iif($group(#queryfilter) == off,.enable,.disable) #queryfilter
echo -a $iif($group(#queryfilter) == off,stopping query filter,starting query filter)
}
else echo -a Query filter is $group(#queryfilter).status
}
menu * {
queryfilter
.on : queryfilter on
.off : queryfilter off
}
menu nicklist {
Query Approval
.add : .approved add
.del : .approved del
}
alias approved {
if $1 == add {
var %a = 1
while %a <= $snick(#ftres,0) {
.hadd -m qcount $+(Approved.,$snick(#ftres,%a)) $snick(#ftres,%a)
inc %a
}
}
elseif $1 == del {
var %a = 1
while %a <= $snick(#ftres,0) {
hdel qcount $+(Approved.,$snick(#ftres,%a))
inc %a
}
}
}
#queryfilter off
on ^*:open:?:*: {
if ($nick isop #ftres) || ($nick isvoice #ftres) { msg $nick sup7 $nick }
elseif ($me isop #ftres) && ($hget(qcount,$address($nick,3)) > 1 ) {
.hinc -m qcount $address($nick,3)
.ban -ku $+ $calc(60 * $hget(qcount,$address($nick,3))) $nick 3 Couldn't read... could ya
}
elseif $hget(qcount,$+(Approved.,$address($nick,3))) {
.msg $nick $read(Approval.txt)
}
else {
.hinc -m qcount $address($nick,3)
.msg $nick Don't msg ops/voices without permission. Repeat violators will be 4kicked/banned.
.timer 1 4 msg $nick Did you get that?
}
}
#queryfilter end
on *:EXIT: {
.hsave -o qcount qcount.hsh
}
on *:disconnect: {
.hsave -o qcount qcount.hsh
}
Query filter can now be turned on/off using /queryfilter or via the menu option. If the filter is already on/off and you go to turn it on/off, it'll tell you that it's already on/off combined kick & mode +b command lines into .ban line removed -m from timer, as using a millisecond timer makes no sense for a 4 second timer....easier on resources also kick/ban times are now dependent on the number of times kick/banned starting at 2 minutes and increasing by a minute each time removed the hfree command in the ON EXIT, as the table would be freed automatically, and added a ON DISCONNECT event. saved file is looked for on start, and if found, loaded into the hash table.
|
|
|
|
Joined: Jul 2005
Posts: 29
Ameglian cow
|
OP
Ameglian cow
Joined: Jul 2005
Posts: 29 |
Sir RusslelB, I am in great debt to you for your direction and guidance. Not only have you steered me in the appropriate direction. You've sacrificed valuable time and personal resources in providing me with a clear explanation as to the methodology behind your implementation.
I commend you RussleB, your dedication, is a inspiration. I'll look through this code you've provided and hopefully I will garnish a greater level of understanding from it.
Again, I thank you.
Whats life without a little Karma? maddkarma[dot]com
|
|
|
|
Joined: Aug 2004
Posts: 7,252
Hoopy frood
|
Hoopy frood
Joined: Aug 2004
Posts: 7,252 |
I hope it works, and it wasn't that long ago that I was a newbie to mIRC programming. Good luck and don't hesitate to ask if you need clarification or repairs on something.
|
|
|
|
Joined: Jul 2005
Posts: 29
Ameglian cow
|
OP
Ameglian cow
Joined: Jul 2005
Posts: 29 |
Okay, just finished initial tests of new implementation. Following problems were discovered: 1. A number of bugs (attributed to spacing problems) were introduced from copying and pasting from web page to text editor (textpad). * Resolved by manually retyping entire script 2. Approved system is broke. Although approved (checked hash and its in there) individual will still be warned not to pm me. 3. Kick on muliple pm is broke. Repeated pms (closed win to trigger "on open" event) just got repeated warning. No kick or ban. error msg: /ban: invalid parameters (line 44, 001.mrc) [color:red] .ban -ku $+ $calc(60 * $hget(qcount,$address($nick,3))) $nick 3 Couldn't read... could ya [/color] That is all I've noticed thus far, everything else seems to work appropriately. Starting and stopping script via menu and command line works. And Ops/Voice getting "no hassle" and others recieive warning working also.
Last edited by goth80; 24/07/05 02:11 PM.
Whats life without a little Karma? maddkarma[dot]com
|
|
|
|
Joined: Aug 2004
Posts: 7,252
Hoopy frood
|
Hoopy frood
Joined: Aug 2004
Posts: 7,252 |
1) That's a problem with this forum board. Nothing I can do to correct it. Next time you might want to copy & paste one line at a time from the code. 2) Oops... stored the information in one format, then tried looking it up in a different format. 3) Oops...had the if/elseif/else statements in the wrong order 4) As far as I'm concerned that's a bug in the timer command. It doesn't like complicated calculations. work around put in place. Code, with all known bugs corrected on *:start: {
hmake qcount 10
if $exists(qcount.hsh) { .hload qcount qcount.hsh }
}
alias queryfilter {
if (!$1) || ($1 != $group(#queryfilter).status) {
$iif($group(#queryfilter) == off,.enable,.disable) #queryfilter
echo -a $iif($group(#queryfilter) == off,stopping query filter,starting query filter)
}
else echo -a Query filter is $group(#queryfilter).status}
}
menu * {
queryfilter
.on : queryfilter on
.off : queryfilter off
}
menu nicklist {
Query Approval .add : .approved add
.del : .approved del
}
alias approved {
if $1 == add {
var %a = 1
while %a <= $snick(#ftres,0) {
.hadd -m qcount $+(Approved.,$snick(#ftres,%a)) $snick(#ftres,%a)
inc %a
}
}
elseif $1 == del {
var %a = 1
while %a <= $snick(#ftres,0) {
hdel qcount $+(Approved.,$snick(#ftres,%a))
inc %a
}
}
}
#queryfilter off
on ^*:open:?:*: {
if ($nick !isreg #ftres) { msg $nick sup7 $nick }
elseif $hget(qcount,$+(Approved.,$nick)) == $nick {
.msg $nick $read(Approval.txt)
}
elseif ($me isop #ftres) && ($hget(qcount,$address($nick,3)) > 1 ) {
.hinc -m qcount $address($nick,3)
var %ban = $calc(60 * $hget(qcount,$address($nick,3)))
.ban -ku $+ %ban $nick 3 Couldn't read... could ya
}
else {
.hinc -m qcount $address($nick,3)
.msg $nick Don't msg ops/voices without permission. Repeat violators will be 4kicked/banned.
.timer 1 4 msg $nick Did you get that?
}
}
#queryfilter end
on *:EXIT: {
.hsave -o qcount qcount.hsh
}
on *:disconnect: {
.hsave -o qcount qcount.hsh
}
|
|
|
|
Joined: Jul 2005
Posts: 29
Ameglian cow
|
OP
Ameglian cow
Joined: Jul 2005
Posts: 29 |
1. ban still generating errors: /ban: invalid parameters (line 47, 002.mrc) [color:red].ban -ku $+ %ban $nick 3 Couldn't read... could ya[/color] Appoval system works fine. All other aspects work fine.
Whats life without a little Karma? maddkarma[dot]com
|
|
|
|
Joined: Dec 2002
Posts: 1,245
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 1,245 |
.ban -ku $+ %ban $nick 3 Couldn't read... could ya
doesn't that need a channel to ban from?
|
|
|
|
Joined: Jul 2005
Posts: 29
Ameglian cow
|
OP
Ameglian cow
Joined: Jul 2005
Posts: 29 |
got it to actually ban by doing .ban #ftres $address($nick,3) -ku $+ %ban $nick 3 Couldn't read... could ya wating to see if timer works No timed ban.. its stays banned. * Pinnys sets mode: +b *!*paulie@*.sf.comcastnet And optimally it should be a kick and ban
Last edited by goth80; 24/07/05 07:31 PM.
Whats life without a little Karma? maddkarma[dot]com
|
|
|
|
Joined: Dec 2002
Posts: 3,547
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 3,547 |
ban $+(-ku,%ban) #ftres $nick 3 Couldn't read... could ya
-Andy
|
|
|
|
Joined: Aug 2004
Posts: 7,252
Hoopy frood
|
Hoopy frood
Joined: Aug 2004
Posts: 7,252 |
Change the ban command to read .ban -ku $+ %ban #ftres $nick 3 Couldn't read... could ya
|
|
|
|
Joined: Jul 2005
Posts: 29
Ameglian cow
|
OP
Ameglian cow
Joined: Jul 2005
Posts: 29 |
This has be a long and educational journey. I truly thank all that have been a part of it. RusselB and SladeKraven your expertise has been invaluable.
HOUSTON... We have NO problems!
Works beautifully, ban sets, then usets appropriate interval according to pm violations.
A great thanks... you guys truly rock.
Whats life without a little Karma? maddkarma[dot]com
|
|
|
|
|