ProIcons commented on a Page, Point System for Chat Activity  -  Feb 19, 2014
 if (%nachrichten. $+ $nick == 4) {

->

 if (%nachrichten. [ $+ [ $nick ] ] == 4) {
xKarpfen  -  Feb 19, 2014

Thanks, but could you tell me why you need these?

ProIcons  -  Feb 19, 2014

Because if Brackets not present, it tries to interpret the variable %nachrichten. first and then on the retrieved data to add the $nick.

For example if u try

if (%nachrichten. $+ $nick == $nick) {

The evaluation will be true, because the %nachricten variable does not contain anything , so the only thing it will be check , will be $nick

if ($nick == $nick) {

so the logical expression is true. Brackets allows you to attack to variable's name something dynamic

xKarpfen  -  Feb 19, 2014

Thanks, i still dont quite understand a lot of this script language..

So like this every 5th message will add 1 point.
How would i have to change it to give points per activity? Like it is right now it gives points for 5 messages without a time window. It could take like 20 hours in theory and give points. Soooo how would i measure activity to like.. messages a minute -> points ?
Sorry if i didnt make it clear.

Another question: How do i post code like that in a comment?

ProIcons  -  Feb 19, 2014

Theres an error in your code

on *:TEXT:*:*: {
  if (%nachrichten. $+ $nick == 4) {
    set %nachrichten. $+ $nick 0
    msg $chan test
    add.pts $+(#,.,$nick)}
    else { inc %nachrichten. $+ $nick }
  }
  msg $chan test2
}

The Else is inherited in the "if", It should be out of the bracket, to continue after if fail.

on *:TEXT:*:*: {
  if (%nachrichten. $+ $nick == 4) {
    set %nachrichten. $+ $nick 0
    msg $chan test
    add.pts $+(#,.,$nick)}
  }
  else { inc %nachrichten. $+ $nick }
  msg $chan test2
}

Use tags [ code]

xKarpfen  -  Feb 19, 2014

Ah, okay thanks so now it will actually do its thing.
How could i make it relative to time? So the %nachrichten decays after like 5 minutes not writing?

ProIcons  -  Feb 19, 2014
on *:TEXT:*:*: {
  if (%nachrichten. [ $+ [ $nick ] ] == 4) {
    set %nachrichten. $+ $nick 0
    msg $chan test
    add.pts $+(#,.,$nick)}
  }
  else { inc %nachrichten. $+ $nick }
  msg $chan test2
  .timer $+ $nick 1 300 unset %nachrichten. [ $+ [ $nick ] ]
}
xKarpfen  -  Feb 19, 2014

Many thanks. Im gonna ask again if something isnt working right.

sonicwolfsdutch  -  Apr 10, 2014

if u could help me i wane get it its not working at all

Sign in to comment

Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.