mIRC Home    About    Download    Register    News    Help

Print Thread
#237079 13/04/12 11:26 AM
Joined: Dec 2008
Posts: 1,515
westor Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,515
Hello,

I have this alias for deleting the variable and does not working.

e.g: /delallmybets

%bet_mynick_total 2
%bet_mynick_1 ....
%bet_mynick_2 ....

Code:
alias delallmybets {
  if (!%bet_ [ $+ [ $nick ] $+ ] _total) { .msg $nick [4Error]: Cannot proceed, You have NOT any BET(s) added since now. - 4FAILED | halt }
  var %t = %bet_ [ $+ [ $nick ] $+ ] _total
  var %i = 1
  while (%i <= %t) {
    unset %bet_ [ $+ [ $nick ] $+ ] _ $+ %i
    if (%i == %t) { .msg $nick [ $+ $nick $+ ]: All of your BET(s) has been deleted. TOTAL: 10 $+ %t $+  - 3SUCCESSFULLY | return }
    inc %i
  }
  inc %i
}


Need Online mIRC help or an mIRC Scripting Freelancer? -> https://irc.chathub.org <-
westor #237080 13/04/12 11:42 AM
Joined: Feb 2003
Posts: 3,432
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
/unset bet_*


if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
sparta #237081 13/04/12 11:48 AM
Joined: Dec 2008
Posts: 1,515
westor Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,515
Yes that helped, thanks!

Now i have an other issue when i wanna see my bets.

Code:
alias listmybets {
  if (!%bet_ [ $+ [ $nick ] $+ ] _total) { .msg $nick [4Error]: Cannot proceed, You have NOT any BET(s) added since now. - 4FAILED | halt }
  var %t = %bet_ [ $+ [ $nick ] $+ ] _total
  var %i = 1
  while (%i <= %t) {
    var %v = %bet_ [ $+ $nick $+ ] _ $+ %i
    .msg $nick [ $+ $nick $+ ]: NUMBER # $+ %i - %v
    if (%i == %t) { .msg $nick [ $+ $nick $+ ]: List BET(s) has been finished. - TOTAL: 10 $+ %t $+  - 3SUCCESSFULLY }
    inc %i
  }
  inc %i
}


Need Online mIRC help or an mIRC Scripting Freelancer? -> https://irc.chathub.org <-
westor #237089 13/04/12 04:27 PM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Change:
Code:
%bet_ [ $+ [ $nick ] $+ ] _total

To:
Code:
$($+(%,bet_,$nick,_total),2)


If you really want to mess around with []'s, you can change it to:
Code:
%bet_ [ $+ [ $nick ] $+ [ _total ] ]


I didn't look closely, so there may be other issues, but there's the first problem I noticed.


Invision Support
#Invision on irc.irchighway.net

Link Copied to Clipboard