mIRC Home    About    Download    Register    News    Help

Topic Options
#262844 - 13/04/18 03:26 PM need help with this script
Vadu Offline
Nutrimatic drinks dispenser

Registered: 13/04/18
Posts: 8
Hello, I'm kinda new to scripting and mirc. Trying to make this script work as it's intended to with a random response for each however it doesn't give the else response. also wondering if anyone knows a way to add it so $nick = me and a separate response works as well. would appreciate it if someone could clear it up for me grin


on *:text:!command *:#channel: {
msg $chan $nick command to $2
msg $chan /timeout $2 10
}

else msg $chan $nick command to $2
msg $chan /timeout $nick 10
}

Top
#262878 - 15/04/18 04:42 PM Re: need help with this script [Re: Vadu]
Vadu Offline
Nutrimatic drinks dispenser

Registered: 13/04/18
Posts: 8
Still need help with this script, if anyone could help i'd appreciate it.

Top
#262880 - 15/04/18 04:50 PM Re: need help with this script [Re: Vadu]
maroon Offline
Hoopy frood

Registered: 12/01/04
Posts: 826
You have no "if", so there's no "else".
You also have an unbalanced number of braces, so the code outside the matched braces is either ignored, or can possibly produce errors depending on what is the text. I don't want to guess what "if" condition you're wanting to make $true in order for the $false to cause your "else" to take action.

The curly braces allow grouping several lines of commands into one branch of a conditional, so you can do something like:'

if ($version > 7) {
command1
command2
}
else {
command3
command4
}

It looks like you need to read a little more about how the scripting language works. Take a better look at your /help as well as look at
https://en.wikichip.org/wiki/mirc/conditional_statements
and other similar topic links there.

Top
#262886 - 15/04/18 07:36 PM Re: need help with this script [Re: maroon]
Vadu Offline
Nutrimatic drinks dispenser

Registered: 13/04/18
Posts: 8
Originally Posted By: maroon
You have no "if", so there's no "else".
You also have an unbalanced number of braces, so the code outside the matched braces is either ignored, or can possibly produce errors depending on what is the text. I don't want to guess what "if" condition you're wanting to make $true in order for the $false to cause your "else" to take action.

The curly braces allow grouping several lines of commands into one branch of a conditional, so you can do something like:'

if ($version > 7) {
command1
command2
}
else {
command3
command4
}

It looks like you need to read a little more about how the scripting language works. Take a better look at your /help as well as look at
https://en.wikichip.org/wiki/mirc/conditional_statements
and other similar topic links there.


Basically when someone uses the command I want it to be randomized for the response given, hence the repeat of command with the user's nickname using the command and who he is using the command on, if that makes sense. if you could put this script together so it works properly i'd appreciate it, I only just started a few days ago so totally clueless sorry, read what you linked and it doesn't really clear everything i'm looking for on the post. frown

Top
#262887 - 15/04/18 09:22 PM Re: need help with this script [Re: Vadu]
maroon Offline
Hoopy frood

Registered: 12/01/04
Posts: 826
You're still being vague as to what you want it to do 'randomly'. If your random response is to pick a random line from a text file and message that to channel, you can use the $read function in a way that returns a random line from a text file:

msg $chan $nick $+ : $read(filename.txt,nt)

Since you did not use a number or other switches, this reads a random line, which the /msg command is "saying" to the channel as if you typed it.

It's going to be frustrating for you to get what you want, when you're being vague about what you want, as well as not understanding the magic scripting language that does things you don't understand.

Top
#262896 - 17/04/18 12:39 AM Re: need help with this script [Re: maroon]
Vadu Offline
Nutrimatic drinks dispenser

Registered: 13/04/18
Posts: 8
Originally Posted By: maroon
You're still being vague as to what you want it to do 'randomly'. If your random response is to pick a random line from a text file and message that to channel, you can use the $read function in a way that returns a random line from a text file:

msg $chan $nick $+ : $read(filename.txt,nt)

Since you did not use a number or other switches, this reads a random line, which the /msg command is "saying" to the channel as if you typed it.

It's going to be frustrating for you to get what you want, when you're being vague about what you want, as well as not understanding the magic scripting language that does things you don't understand.


Response a would be the message and the timeout on $2 who the $user used the cmd on, response b would be the msg and timeout on $user who used the cmd, I understand the basic stuff on it just more in depth scripting is not really something I can pickup on easy, i've been looking over it for a few days now and still have no clue how to set the response to be random nor how to set a response if someone used the cmd on me.


Edited by Vadu (17/04/18 12:40 AM)

Top
#262897 - 17/04/18 12:44 AM Re: need help with this script [Re: Vadu]
Vadu Offline
Nutrimatic drinks dispenser

Registered: 13/04/18
Posts: 8
I've got everything else on my scripts done it's just this one script i've been looking to make, don't get why people are making it so complicated to even discuss it, like if you know how to do the script why not just copy/paste it for me with a little explanation instead of trying to tell me what I already know.

It doesn't take much to be a nice person and help someone out.

Top
#262898 - 17/04/18 01:20 AM Re: need help with this script [Re: Vadu]
maroon Offline
Hoopy frood

Registered: 12/01/04
Posts: 826
I guess "people" is me, the only one who has replied. I was having trouble understanding you, so I took a guess at what you wanted, and apparently guessed wrong. I can't "put the script together", as I have no idea what it's supposed to do.

If you want a response to be random, then use $rand(). You can have var %a = $rand(1,3) pick a random number from 1-3, or $rand(a,c) pick a random letter from 'a' to 'c'. You can then take your random action depending on what value is in %a. If %a has the value 'a' or 'b' or 'c', you can:

if (%a = a) do action1
if (%a = b) do action2
if (%a = c) do action3

Or you can create labels ":labelA" and ":labelB" and ":labelC", where the different actions are located, then you can do:

goto Label $+ $rand(a,c)

Top
#262899 - 17/04/18 02:52 AM Re: need help with this script [Re: Vadu]
Tano Offline
Ameglian cow

Registered: 12/04/18
Posts: 24
Guys thx for the suggestion i am not master in this code language
if someoe can help me to make it right like a script thank you, cozz i dont understand what to put here to put or what function they have i just make some modification here from another script so if anyone of u can write right the code a script what is need to be right to match the badword spammer ty in advance

Top
#262900 - 17/04/18 02:55 AM Re: need help with this script [Re: Vadu]
Tano Offline
Ameglian cow

Registered: 12/04/18
Posts: 24


alias bwcontrol {
var %:control = 1 | while %:control <= $strip($1)(#,0) {
if $hfind(badword,$strip($1)(#,%:control),1,W).data {
.echo $token(%:c,%c,32) [ CONTROL ] $strip($1)(#,%:control) Badword Matched $+([,$chr(32),$hget(badword,$hfind(badword,$strip($1)(#,%:control),1,W).data),$chr(32),])
ban -u300 # $mask($fulladdress,2)(#,%:control)
}
inc %:control
}
}

on *:start:{ $iif(!$isfile(badword.list),.write badword.list) | .hmake badword 100 | .hload badword badword.list }
#bwaddon off
on *:text:*:#: badword $1-
on *:action:*:#: badword $1-
alias -l badword {
if (!$nick(#,$nick,rv,oh%&~)) return
if (($me isop $chan) || ($me ishelp $chan)) {
if $hfind(badword,$strip($1-),1,W).data {
echo $token(%:c,%c,32) [ BADWORD ] $strip($1-) Badword is Indetifier From The List. $+([,$chr(32),$hget(badword,$hfind(badword,$strip($1-),1,W).data),$chr(32),])
var %:c $regsubex($str(-,$read($strip($1-),0)),/./g, $iif($regex($badword($read($strip($1-),\n),$me).pbadword,/(%|@|&|~\.)/i),$read($strip($1-),\n) $chr(32)))
var %c = 1 | while %c <= $token(%:c,0,32) {
mode # $token(%:c,%c,32) +b $mask($fulladdress,2) | notice $nick 5Stop Dont Swear..
echo $chan [ Indetifier ] $strip($1-) Is Indetifier The Badword From The List. $+([,$chr(32),$hget(badword,$hfind(badword,$strip($1-),1,W).data),$chr(32),])
}
}
}
}
#badnickaddon end



this is a script i have with the help from maroon but i cant understand much i am not a specialist for code script to understand what to put where or what need to put what function i did till now with help of maroon thx to him, but i dont understand the language of script, so what i need is 1 to write the script in the section where is start to match the badowrd list on speaker users text and give ban for this badwords


Edited by Tano (17/04/18 03:36 AM)

Top
#262901 - 17/04/18 03:01 AM Re: need help with this script [Re: maroon]
Tano Offline
Ameglian cow

Registered: 12/04/18
Posts: 24
maroon i want to give ban to the users who make flood spammer with badwords in channel i add del with wilcard the words and nedd to be match the badowrds i put in list when some user make flood or spammer repeat in channel
why is so difficult what i ask lol
i need somone to fix my problem to write teh code script
i am here for help not to say i know everything i just copy from badnick script ane convert in badword script now i am asking help from who understand this kind of code scripts to write the right code script to work for that i am asking help for script here

Top
#262904 - 17/04/18 02:35 PM Re: need help with this script [Re: maroon]
Vadu Offline
Nutrimatic drinks dispenser

Registered: 13/04/18
Posts: 8
Originally Posted By: maroon
I guess "people" is me, the only one who has replied. I was having trouble understanding you, so I took a guess at what you wanted, and apparently guessed wrong. I can't "put the script together", as I have no idea what it's supposed to do.

If you want a response to be random, then use $rand(). You can have var %a = $rand(1,3) pick a random number from 1-3, or $rand(a,c) pick a random letter from 'a' to 'c'. You can then take your random action depending on what value is in %a. If %a has the value 'a' or 'b' or 'c', you can:

if (%a = a) do action1
if (%a = b) do action2
if (%a = c) do action3

Or you can create labels ":labelA" and ":labelB" and ":labelC", where the different actions are located, then you can do:

goto Label $+ $rand(a,c)



i'll show you how the command is going to be used here:

Username1 uses command on username2 of their choice: !commandname username2

the command would either response with:

Username1 does action to username2
/timeout $2

username1 does action to username2, "add extra command response for what the command would be used as"
/timeout $1

If the $nick username1 used it on is a moderator, it would response with: command failed, you cannot target that user.

I've been looking for a while for a base/script for this but cannot find anything as specific.

Top
#262907 - 17/04/18 03:54 PM Re: need help with this script [Re: Vadu]
maroon Offline
Hoopy frood

Registered: 12/01/04
Posts: 826
If by 'moderator' this means you are on Twitch, that network does not always do everything in the standard IRC method, so not all commands work the same. For example Twitch recognizes the Whisper command, but not the Notice command.

If 'moderator' means an Op who has the @ symbol next to their nick, the :TEXT: event can begin like:

if ($2 isop $chan) { msg # command failed, $nick cannot target that user $2 | return }

Where you have "/timeout $2 " does that mean you are wanting to display that text to channel? Or are you trying to limit people from using the command too often? Such as having a 60 second period where that same nick cannot use the !command again, but also have a 30 second period where nobody at all can use it?

By "extra command response", do you mean that it randomly replies with 2 different responses, where one is longer than the other? Or that it sometimes responds with 1 message, and other times it responds with 2 messages?

Top
#262910 - 17/04/18 05:52 PM Re: need help with this script [Re: maroon]
Vadu Offline
Nutrimatic drinks dispenser

Registered: 13/04/18
Posts: 8
Originally Posted By: maroon
If by 'moderator' this means you are on Twitch, that network does not always do everything in the standard IRC method, so not all commands work the same. For example Twitch recognizes the Whisper command, but not the Notice command.

If 'moderator' means an Op who has the @ symbol next to their nick, the :TEXT: event can begin like:

if ($2 isop $chan) { msg # command failed, $nick cannot target that user $2 | return }

Where you have "/timeout $2 " does that mean you are wanting to display that text to channel? Or are you trying to limit people from using the command too often? Such as having a 60 second period where that same nick cannot use the !command again, but also have a 30 second period where nobody at all can use it?

By "extra command response", do you mean that it randomly replies with 2 different responses, where one is longer than the other? Or that it sometimes responds with 1 message, and other times it responds with 2 messages?







Yes on twitch, that's the one I was looking for referring to moderators thanks,

where I have "/timeout $2" the command is basically like a Sudoku command where the person using it can timeout someone or be timed out.

I know about cooldowns on scripts, So basically it would give either response 1 or 2 at random, I don't want the command to be set so it always gives $1 over $2.

I see what you mean now though, just need to put the script together and hopefully it works as intended, if you have any tips for me to make this script easier i'd appreciate it.


Edited by Vadu (17/04/18 05:56 PM)

Top