mIRC Home    About    Download    Register    News    Help

Topic Options
#248617 - 13/10/14 11:06 PM -ul=mod
Spike Offline
Ameglian cow

Registered: 18/09/14
Posts: 46
I know this might not be the right place to ask this as its most used on twitch bots, But some bots on twitch have a thing like -ul=mod so like !addcom !modonly -ul=mod Mod only Command!

If anyone knows how to do this please tell me.

Top
#248624 - 14/10/14 01:24 AM Re: -ul=mod [Re: Spike]
Spike Offline
Ameglian cow

Registered: 18/09/14
Posts: 46
No one?

Top
#248625 - 14/10/14 01:32 AM Re: -ul=mod [Re: Spike]
westor Offline
Hoopy frood

Registered: 27/12/08
Posts: 1511
Loc: Greece
First of all where do you want to save your command, second do you already have any !addcom command code?
_________________________
Need Online mIRC help or an mIRC Scripting Freelancer? -> http://westor.ucoz.com/contact <-

Top
#248626 - 14/10/14 03:26 AM Re: -ul=mod [Re: westor]
Spike Offline
Ameglian cow

Registered: 18/09/14
Posts: 46
I have a !addcom code thing setup, And my commands are saved in a file called commands.txt

Top
#248631 - 14/10/14 02:52 PM Re: -ul=mod [Re: westor]
Spike Offline
Ameglian cow

Registered: 18/09/14
Posts: 46
Originally Posted By: westor
First of all where do you want to save your command, second do you already have any !addcom command code?

Sorry for the two replys, Forgot to do a quote,
I save my commands in a file called commands.txt and yes i have a !addcom command code.

Top
#248632 - 14/10/14 04:45 PM Re: -ul=mod [Re: Spike]
westor Offline
Hoopy frood

Registered: 27/12/08
Posts: 1511
Loc: Greece
Can you please paste here the currently code that you have? to improve it
_________________________
Need Online mIRC help or an mIRC Scripting Freelancer? -> http://westor.ucoz.com/contact <-

Top
#248635 - 14/10/14 05:04 PM Re: -ul=mod [Re: westor]
Spike Offline
Ameglian cow

Registered: 18/09/14
Posts: 46
Originally Posted By: westor
Can you please paste here the currently code that you have? to improve it

Heres the !addcom code.


Code:
on *:text:!addcom *:#: {
  if ($nick isop #) {
    write commands.txt $2-
    msg $chan /me + Command $2 has been created!
  }
}
on *:text:!delcom *:#: {
  if ($nick isop #) {
    if ($read(commands.txt, ns, $2)) {
      write -dl $+ $readn commands.txt
      msg $chan /me - Command $2- has been removed!
    }
  }
}
on *:text:!editcom & *:#: {
  if ($nick isop #) {
    if ($read(commands.txt, ns, $2)) {
      write -l $+ $readn commands.txt $2-
      msg $chan /me -> Command $2 has been edited!
    }
  }
}
on *:text:*:#: {
  if ($read(commands.txt, ns, $1)) {
    msg $chan $v1
  }
}

Top
#248636 - 14/10/14 05:48 PM Re: -ul=mod [Re: Spike]
westor Offline
Hoopy frood

Registered: 27/12/08
Posts: 1511
Loc: Greece
Try using this code:

Syntax: !addcom <command> [-ul=mod] <text>
Example: !addcom !test -ul=mod This is an test command.
Example 2: !addcom !test2 This is an test2 command.

Code:
on *:text:!addcom *:#: {
  if ($nick isop #) {
    write commands.txt $2-
    msg $chan /me + Command $2 has been created!
  }
}
on *:text:!delcom *:#: {
  if ($nick isop #) {
    if ($read(commands.txt, ns, $2)) {
      write -dl $+ $readn commands.txt
      msg $chan /me - Command $2- has been removed!
    }
  }
}
on *:text:!editcom & *:#: {
  if ($nick isop #) {
    if ($read(commands.txt, ns, $2)) {
      write -l $+ $readn commands.txt $2-
      msg $chan /me -> Command $2 has been edited!
    }
  }
}
on *:text:*:#: {
  tokenize 32 $strip($1-,burci)
  if ($read(commands.txt, ns, $1)) {
    var %com = $v1
    if (-ul=mod == $gettok(%com,1,32)) && ($nick !isop $chan) { msg $chan [ $+ $nick $+ ]: Error, You are NOT an channel operator! | return }
    msg $chan $gettok(%com,2-,32)
  }
}


Edited by westor (14/10/14 05:50 PM)
_________________________
Need Online mIRC help or an mIRC Scripting Freelancer? -> http://westor.ucoz.com/contact <-

Top
#248638 - 14/10/14 06:06 PM Re: -ul=mod [Re: westor]
Spike Offline
Ameglian cow

Registered: 18/09/14
Posts: 46
Originally Posted By: westor
Try using this code:

Syntax: !addcom <command> [-ul=mod] <text>
Example: !addcom !test -ul=mod This is an test command.
Example 2: !addcom !test2 This is an test2 command.

Code:
on *:text:!addcom *:#: {
  if ($nick isop #) {
    write commands.txt $2-
    msg $chan /me + Command $2 has been created!
  }
}
on *:text:!delcom *:#: {
  if ($nick isop #) {
    if ($read(commands.txt, ns, $2)) {
      write -dl $+ $readn commands.txt
      msg $chan /me - Command $2- has been removed!
    }
  }
}
on *:text:!editcom & *:#: {
  if ($nick isop #) {
    if ($read(commands.txt, ns, $2)) {
      write -l $+ $readn commands.txt $2-
      msg $chan /me -> Command $2 has been edited!
    }
  }
}
on *:text:*:#: {
  tokenize 32 $strip($1-,burci)
  if ($read(commands.txt, ns, $1)) {
    var %com = $v1
    if (-ul=mod == $gettok(%com,1,32)) && ($nick !isop $chan) { msg $chan [ $+ $nick $+ ]: Error, You are NOT an channel operator! | return }
    msg $chan $gettok(%com,2-,32)
  }
}


Works great thanks laugh

Top
#248647 - 14/10/14 10:11 PM Re: -ul=mod [Re: westor]
Spike Offline
Ameglian cow

Registered: 18/09/14
Posts: 46
Originally Posted By: westor
Try using this code:

Syntax: !addcom <command> [-ul=mod] <text>
Example: !addcom !test -ul=mod This is an test command.
Example 2: !addcom !test2 This is an test2 command.

Code:
on *:text:!addcom *:#: {
  if ($nick isop #) {
    write commands.txt $2-
    msg $chan /me + Command $2 has been created!
  }
}
on *:text:!delcom *:#: {
  if ($nick isop #) {
    if ($read(commands.txt, ns, $2)) {
      write -dl $+ $readn commands.txt
      msg $chan /me - Command $2- has been removed!
    }
  }
}
on *:text:!editcom & *:#: {
  if ($nick isop #) {
    if ($read(commands.txt, ns, $2)) {
      write -l $+ $readn commands.txt $2-
      msg $chan /me -> Command $2 has been edited!
    }
  }
}
on *:text:*:#: {
  tokenize 32 $strip($1-,burci)
  if ($read(commands.txt, ns, $1)) {
    var %com = $v1
    if (-ul=mod == $gettok(%com,1,32)) && ($nick !isop $chan) { msg $chan [ $+ $nick $+ ]: Error, You are NOT an channel operator! | return }
    msg $chan $gettok(%com,2-,32)
  }
}


Wait, One thing i wanna ask can you like use !editcom to make it so you can make a non mod only command, A mod only command
Like for example,
!addcom !test Hello
Then i was like Oh, I forgot the mod only part.
So then i could do
!editcom !test -ul=mod Hello

Top
#248655 - 15/10/14 01:19 AM Re: -ul=mod [Re: Spike]
westor Offline
Hoopy frood

Registered: 27/12/08
Posts: 1511
Loc: Greece
Try use this code:

Code:
on *:text:!addcom *:#: {
  if ($nick isop #) {
    var %r = $read(commands.txt,ns,$2)
    if (%r) { .msg $chan [ $+ $nick $+ ]: Error, This command $qt($2) is already exist into the database! | return }
    write commands.txt $2-
    msg $chan /me + Command $2 has been created!
  }
}
on *:text:!delcom *:#: {
  if ($nick isop #) {
    var %r = $read(commands.txt,ns,$2)
    if (!%r) { .msg $chan [ $+ $nick $+ ]: Error, This command $qt($2) does NOT exist into the database! | return }
    write -dl $+ $readn commands.txt
    msg $chan /me - Command $2- has been removed!
  }
}
on *:text:!editcom & *:#: {
  if ($nick isop #) {
    var %r = $read(commands.txt,ns,$2)
    if (!%r) { .msg $chan [ $+ $nick $+ ]: Error, This command $qt($2) does NOT exist into the database! | return }
    write -l $+ $readn commands.txt $2-
    msg $chan /me -> Command $2 has been edited!
  }
}
on *:text:*:#: {
  tokenize 32 $strip($1-,burci)
  if ($read(commands.txt, nts, $1)) {
    var %com = $v1
    if (-ul=mod == $gettok(%com,1,32)) && ($nick !isop $chan) { msg $chan [ $+ $nick $+ ]: Error, You are NOT an channel operator! | return }
    msg $chan $iif(-ul=mod == $gettok(%com,1,32),$gettok(%com,2-,32),$gettok(%com,1-,32))
  }
}
_________________________
Need Online mIRC help or an mIRC Scripting Freelancer? -> http://westor.ucoz.com/contact <-

Top
#248656 - 15/10/14 01:32 AM Re: -ul=mod [Re: westor]
Spike Offline
Ameglian cow

Registered: 18/09/14
Posts: 46
Originally Posted By: westor
Try use this code:

Code:
on *:text:!addcom *:#: {
  if ($nick isop #) {
    var %r = $read(commands.txt,ns,$2)
    if (%r) { .msg $chan [ $+ $nick $+ ]: Error, This command $qt($2) is already exist into the database! | return }
    write commands.txt $2-
    msg $chan /me + Command $2 has been created!
  }
}
on *:text:!delcom *:#: {
  if ($nick isop #) {
    var %r = $read(commands.txt,ns,$2)
    if (!%r) { .msg $chan [ $+ $nick $+ ]: Error, This command $qt($2) does NOT exist into the database! | return }
    write -dl $+ $readn commands.txt
    msg $chan /me - Command $2- has been removed!
  }
}
on *:text:!editcom & *:#: {
  if ($nick isop #) {
    var %r = $read(commands.txt,ns,$2)
    if (!%r) { .msg $chan [ $+ $nick $+ ]: Error, This command $qt($2) does NOT exist into the database! | return }
    write -l $+ $readn commands.txt $2-
    msg $chan /me -> Command $2 has been edited!
  }
}
on *:text:*:#: {
  tokenize 32 $strip($1-,burci)
  if ($read(commands.txt, nts, $1)) {
    var %com = $v1
    if (-ul=mod == $gettok(%com,1,32)) && ($nick !isop $chan) { msg $chan [ $+ $nick $+ ]: Error, You are NOT an channel operator! | return }
    msg $chan $iif(-ul=mod == $gettok(%com,1,32),$gettok(%com,2-,32),$gettok(%com,1-,32))
  }
}


Could you give me an example of how i would use the command to make it mod only?

Top
#248657 - 15/10/14 01:45 AM Re: -ul=mod [Re: Spike]
westor Offline
Hoopy frood

Registered: 27/12/08
Posts: 1511
Loc: Greece
Yes.

Add command: !addcom <command> [-ul=mod] <text>
example: !addcom !test test here with mod
example2 !addcom !testmod -ul=mod test here with moderation

Del command: !delcom <command>
example: !delcom !test

Edit command: !editcom <command> [-ul=mod] <text>
example: !editcom !test test here with mod
example2 !editcom !testmod -ul=mod test here with moderation
_________________________
Need Online mIRC help or an mIRC Scripting Freelancer? -> http://westor.ucoz.com/contact <-

Top