Help

By gekkegast on Nov 26, 2011

Hello, I created a snippet.
I wanted a music script in my bot, that every 60 seconds the song shows.
But the script does, now everytime says the Same song the same and number.
Bit, if i say ]music now, than says my bot the correct number and time
Does anyone have a tip, why my bot every time this says.

Sorry for my bad english, but my English is not that good.

Screenshot!

on *:TEXT:]music *:*: {
  set %music $dde(mPlug,format,"4Muziek:_%name_[%4]_(%pm:%ps/%min:%sec)_[%br~Kbps_-_%sr~KHz_-_%typ]")
  set %time timer 0 60
  if ($2 == on) {
    if ($readini(Lotk.ini, $address($nick,2), access) >= 800) {
      %time msg # $dde(mPlug,format,"4Muziek:_%name_[%4]_(%pm:%ps/%min:%sec)_[%br~Kbps_-_%sr~KHz_-_%typ]")
      msg # Music player is now on
      unset %music
    }
    else { notice $nick You need access level 800 to perform this command. | HALT }
  }
  if ($2 == now) {
    if ($readini(Lotk.ini, $address($nick,2), Access) >= 800) || ($readini($chan $+ Lotk.ini, $address($nick,2), Access) >= 800) {
      msg # %music
    }
    else { notice $nick You need access level 800 to perform this command. | HALT }
  } 
  if ($2 == off) {
    if ($readini(Lotk.ini, $address($nick,2), access) >= 800) {
      timers off
      msg # Music player is now off
    }
    else { notice $nick You need access level 800 to perform this command. | HALT }
  }
}

Comments

Sign in to comment.
gekkegast   -  Nov 30, 2011

@Fuzionx

Thanks, it works now.

14:53:25 30/11/11 » @Gekkegast « ]music on
14:53:25 30/11/11 » @Lotk « Music player is now on
14:53:31 30/11/11 » @Lotk « Muziek: Benton - New-ro-phen [] (00:13/05:36) [320Kbps - 44KHz - Stereo]
14:53:35 30/11/11 » @Lotk « Muziek: Benton - New-ro-phen [] (00:18/05:36) [320Kbps - 44KHz - Stereo]
14:53:41 30/11/11 » @Lotk « Muziek: Benton - New-ro-phen [] (00:23/05:36) [320Kbps - 44KHz - Stereo]

 Respond  
Fuzionx   -  Nov 29, 2011

The $dde() identifier is being evaluated when you start the timer and not when it fires. You store the current song in the timer and than say it every 60 seconds.
Dutch: Het commando $dde() word uitgevoerd wanneer jij de timer start, en niet als de timer afgaat (elke 60 seconden dus). Het liedje wat op dat moment aan staat word in de timer opgeslagen en die zegt het gewoon elke 60 seconden. Voorbeeld: Je luistert het liedje "David Guetta - Titanium" en je voert dit commando uit:

%time msg # $dde(mPlug,format,"4Muziek:_%name_[%4]_(%pm:%ps/%min:%sec)_[%br~Kbps_-_%sr~KHz_-_%typ]")

Dan zet hij dit in de timer:

  • Active timers:
  • Timer 1 60s delay /msg #channel David Guetta - Titanium ()

You should make an alias for messaging the current song and excecute that every 60 seconds.
Dutch: Je moet een alias maken die het huidige liedje messaged naar de channel en die elke 60 seconden uitvoeren. Voorbeeld:

; The alias
alias nowplaying {
  if ($me ison $$1) {
    msg $1 $dde(mPlug,format,"4Muziek:_%name_[%4]_(%pm:%ps/%min:%sec)_[%br~Kbps_-_%sr~KHz_-_%typ]")
  }
}

; The timer
timer 0 60 nowplaying $chan

This way it should message the current playing song everytime.
Dutch: met deze manier word elke keer het huidige liedje gemessaged naar de channel

 Respond  
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.