mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Dec 2014
Posts: 24
J
Jokke Offline OP
Ameglian cow
OP Offline
Ameglian cow
J
Joined: Dec 2014
Posts: 24
Hi Guys!

Code:
alias -1 addPoints {
  if {$1 !isnum) { echo 2 -st $1 is not a number. It need to be a number. | halt }
  var %topic $+($chan,.,$nick)
  var %points $calc($readini(Points.ini,%topic,Points) + $1)
  writeini -n Points.ini %topic Points %points
  return %points
}
alias -l lookUpPoints {
  var %topic $+($chan,.,$nick)
  var %points $readini(Points.ini,%topic,Points)
  return %points
}
alias doaddpoints {
  if ($3 !isnum) { echo 2 -st $3 is not a number. It needs to be a number. | halt }
  var %topic $+($1,.,$2)
  var %points $calc($readini(Points.ini,%topic,Points) + $3)
  writeini -n Points.ini %topic Points %points
  echo -a Added points for %topic
}
alias dorempoints {
  var %topic $+($1,.,$2)
  remini -n Points.ini %topic Points
  echo -a Removed points for %topic
}
on *:text:!points:#husbotten:{
  if ($nick isop #) {
    msg # $nick has $readini(Points.ini,$+(#gamerhuset,.,$nick),Points) total points.
  }
  else { 
    if ((%floodpoints) || ($($+(%,floodpoints.,$nick),2))) { return }
    set -u1 %floodpoints On
    set -u2 %floodpoints. $+ $nick On
    msg # $nick has $readini(Points.ini,$+(#gamerhuset,.,$nick),Points) total points.
  }
}
on $*:text:/!points (add|remove)/Si:#husbotten:{
  if ($nick isop #) {
    if ($0 < 3) { msg # Insufficient parameters: Use !points <add|remove> <user> [number] | return }
    writeini -n Points.ini $+(#,.,$3) Points $calc($readini(Points.ini,$+(#,.,$3),Points) $iif($2 == add,+,-) $iif($4 isnum,$4,1))
    { msg $chan $3 now has $readini(Points.ini,$+(#,.,$3),Points) total points. }
  }
  else { msg $chan This command is only available to moderators. }
}
on !*:join:#gamerhuset:{
  $+(.timerpoints.,#,.,$nick) 0 3600 add.pts $+(#gamerhuset,.,$nick)
  add.pts $+(#,.,$nick)
  if ((%floodjoin) || ($($+(%,floodjoin.,$nick),2))) { return }
  set -u10 %floodjoin On
  set -u30 %floodjoin. $+ $nick On
  echo $nick has joined and is now earning points.
}
on !*:part:#gamerhuset:$+(.timerpoints.,#,.,$nick) off
alias -l add.pts {
  writeini -n Points.ini $1 Points $calc($readini(Points.ini,$1,Points) + 1)
  if ((%floodpart) || ($($+(%,floodpart.,$nick),2))) { return }
  set -u10 %floodpart On
  set -u30 %floodpart. $+ $nick On
  echo $nick has left the channel and is no longer earning points.
}


i've got this code, and the script is working perfectly. I've got one problem doe, is the .ini file point cap is at 255. Anyone who can figure it out?

Joined: Jun 2014
Posts: 248
B
Fjord artisan
Offline
Fjord artisan
B
Joined: Jun 2014
Posts: 248
It doesn't max at 255. Problem solved. You're welcome.

This is horrific

Code:
on !*:part:#gamerhuset:$+(.timerpoints.,#,.,$nick) off
alias -l add.pts {
  writeini -n Points.ini $1 Points $calc($readini(Points.ini,$1,Points) + 1)
  if ((%floodpart) || ($($+(%,floodpart.,$nick),2))) { return }
  set -u10 %floodpart On
  set -u30 %floodpart. $+ $nick On
  echo $nick has left the channel and is no longer earning points.
}

Joined: Jan 2014
Posts: 107
M
Vogon poet
Offline
Vogon poet
M
Joined: Jan 2014
Posts: 107
Originally Posted By: Jokke
Hi Guys!

i've got this code, and the script is working perfectly. I've got one problem doe, is the .ini file point cap is at 255. Anyone who can figure it out?


Did you mean to use the word "though" here?

This may be your problem. If you cannot understand simple english syntax, your bot syntax may be broken all over the place.

Joined: Dec 2013
Posts: 779
N
Hoopy frood
Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 779
Granted that the code Jokke presented is broken, has errors and is overall god awful. But you really have no say in this matter with the level of scripting you bring.
From what I can see you haven't scripted a single one of the scripts you have in your signature, yet you still boast that you know mSL and enter various discussions that you have no clue about.

Now, to make this post not entirely off topic: @Jokke, your script has syntax errors all over, and no, not English syntax errors, just basic mSL errors. For instance:
Code:
on $*:text:/!points (add|remove)/Si:#husbotten:{
  if ($nick isop #) {
    if ($0 < 3) { msg # Insufficient parameters: Use !points <add|remove> <user> [number] | return }
    writeini -n Points.ini $+(#,.,$3) Points $calc($readini(Points.ini,$+(#,.,$3),Points) $iif($2 == add,+,-) $iif($4 isnum,$4,1))
    { msg $chan $3 now has $readini(Points.ini,$+(#,.,$3),Points) total points. }
  }
  else { msg $chan This command is only available to moderators. }
}
I have no idea how this will translate considering you have an opening bracket without a statement in the middle of nowhere. Another example is this:
Code:
on !*:join:#gamerhuset:{
  $+(.timerpoints.,#,.,$nick) 0 3600 add.pts $+(#gamerhuset,.,$nick)
  add.pts $+(#,.,$nick)
  if ((%floodjoin) || ($($+(%,floodjoin.,$nick),2))) { return }
  set -u10 %floodjoin On
  set -u30 %floodjoin. $+ $nick On
  echo $nick has joined and is now earning points.
}
on !*:part:#gamerhuset:$+(.timerpoints.,#,.,$nick) off
alias -l add.pts {
  writeini -n Points.ini $1 Points $calc($readini(Points.ini,$1,Points) + 1)
  if ((%floodpart) || ($($+(%,floodpart.,$nick),2))) { return }
  set -u10 %floodpart On
  set -u30 %floodpart. $+ $nick On
  echo $nick has left the channel and is no longer earning points.
}
When a user joins, you'll trigger the add.pts alias. The add.pts alias will 1 up the user's value in Points.ini #Gamerhuset.User Points=Value, then it will proceed to echo that the user has left the channel and is no longer earning points, and then echo once more that the user is there an earning points. This as the same time as triggering the "flood control" variables every bad twitch scripter has taken a liking to for no real reason. The reason people use that is to prevent their bot to spam channels, triggering a global ip ban on twitch.


Nillens @ irc.twitch.tv
Nillen @ irc.rizon.net

Link Copied to Clipboard