mIRC Homepage
Posted By: David_James Can anyone help me with this? - 08/10/05 05:03 AM
Can anyone help me with this remote.
!Addcmd my bot will add this cmd into cmd.hsh. i.e: !Addcmd !wb my bot will add !wb into the cmd list of a channel in cmd.hsh.
!Delcmd my bot will del this cmd from the cmd list of a channel in cmd.hsh.
!listcmd my bot will list all the cmd are available in a channel from cmd.hsh.
Finally, when someone type a cmd, example: !wb David_James is a channel, my bot will find this cmd of this channel and msg to channel back. I want this bot work for multiple channel.
Sorry, for my bad English.
Posted By: Lpfix5 Re: Can anyone help me with this? - 08/10/05 03:39 PM
Im not sure what your asking for exactly 100% i had to read it a few times but...

;Setup
Code:

alias cmdlist {
hmake cmd $?="How many items? 30 is average"
hsave cmd cmd.hsh
}

Here you will have to type /cmdlist then press enter and load the cmd hsh table



;Usage

Code:

on *:TEXT:*:#: {
[color:green];Channel for all # channel for a few = #channel1,#channel2 etc... seperated always by a coma[/color]
if ($1 == !Addcmd) && (! == $left($2,+1)) {
hadd cmd $2
hsave cmd cmd.hsh
}
if ($1 == !Delcmd) && (! == $left($2,+1)) {
hdel cmd $2
hsave cmd cmd.hsh
}
else { msg $chan Sorry $nick $+ , I cannot add that to file or delete since it does not start by ! }
}



So far i included the ability to add and del cmd from hash file but im not sure how you want to use this

your saying !WB David_James is a channel << this part i dont understand how you want the script to react to it...
Posted By: David_James Re: Can anyone help me with this? - 08/10/05 03:55 PM
Okay, let me explain you more. When I type
!Addcmd !wb Welcome to $chan $nick, my bot will add !wb Welcome to $chan $nick into cmd.hsh. If someone type !wb <nick>, my bot wil send Welcome to #Channel <nick> to the channel. And I also want to have !listcmd, that will list all availabl cmds are in the channel.
Posted By: Lpfix5 Re: Can anyone help me with this? - 08/10/05 04:33 PM
I dont see that being possible at the moment to put something like !addcmd !wb Welcome to my channel $chan $nick

reason behind it it will psychially write $chan and $nick to the hash table.. ill look into it post if anything
Posted By: RusselB Re: Can anyone help me with this? - 08/10/05 04:34 PM
I know I've seen something similar to this, but at the moment I can't find it. I'll post the link as soon as I find it, though.

I've had no luck in finding the post I was mentioning, so here's a quick code that I think should work. I'm unable to test it at present.
Code:
on *:start:{
  if !$hget(Commands) { .hmake Commands 10 }
  if $exists(Commands.hsh) { .hload Commands Commands.hsh }
}

on *:load:{
  if !$hget(Commands) { .hmake Commands 10 }
  if $exists(Commands.hsh) { .hload Commands Commands.hsh }
}
on *:text:!addcmd*:*:{
  if $hget(Commands,$2) {
    .msg $nick That command has already been entered
  }
  else {
    .hadd -m Commands $2 $3-
  }
}
on *:text:*:*:{
  if $hget(Commands,$1) {
    $eval($hget(Commands,$1))
  }
}
on *:exit:{
  .hsave -o Commands Commands.hsh
}
on *:disconnect:{
  .hsave -o Commands Commands.hsh
}
  
Posted By: Lpfix5 Re: Can anyone help me with this? - 08/10/05 04:41 PM
well here to list commands ill do a simple loop to read commands

Code:

on *:TEXT:*:#: {
if ($1 == !listcmds) {
var %listcmds.inc = 1
msg $nick Listing Commands...
while (%listcmds.inc &lt;= $hget(cmd,0).item) {
msg $nick $hget(cmd,%listcmds.inc).item
inc %listcmds.inc
}
}
}

Posted By: Lpfix5 Re: Can anyone help me with this? - 08/10/05 06:19 PM
This should suffice everything...

usage

/cmdlist
; to setup a cmd.hsh table

hnick == $nick
hchan == $chan

!Addcmd cmdhere texthere

ex:. !Addcmd !Wb Welcome back to hchan Enjoy your stay hnick

!Delcmd cmdherewhichalreadyexist

Code:

on *:TEXT:*:#: {
  if ($1 == !listcmds) {
    var %listcmds.inc = 1
    msg $nick Listing Commands...
    while (%listcmds.inc &lt;= $hget(cmd,0).item) {
      msg $nick $hget(cmd,%listcmds.inc).item
      inc %listcmds.inc
    }
  }
  if (! isin $2) {
    if ($1 == !Addcmd) &amp;&amp; (! == $left($2,+1)) {
      hadd cmd $2 $3-
      hsave cmd cmd.hsh
    }
    if ($1 == !Delcmd) &amp;&amp; (! == $left($2,+1)) {
      hdel cmd $2
      hsave cmd cmd.hsh
    }
  }  
  if (! isin $1) {
    var %hreplace = $hget(cmd,$1)
    if (hnick isin %hreplace) &amp;&amp; (hchan isin %hreplace) {
      msg $chan $replace(%hreplace,hnick,$2,hchan,$active)
    }
    elseif (hnick isin %hreplace) {
      msg $chan $replace(%hreplace,hnick,$2)
    }
    elseif (hchan isin %hreplace) {
      msg $chan $replace(%hreplace,hchan,$chan)
    }
    else { msg $chan %hreplace }
  }
}

alias cmdlist {
  hmake cmd $?="How many items? 30 is average"
  hsave cmd cmd.hsh
}

Posted By: David_James Re: Can anyone help me with this? - 09/10/05 05:48 AM
Well, it's close to what I need. The problem is that, my bot is on alot of channels, if I want each channel has its own cmd list, what should I do? I tested the script above, it has only one cmd list for every channel. frown And if it is possible, pls help to check if a !cmd is already existed, it won't add into cmd.hsh.
Posted By: Lpfix5 Re: Can anyone help me with this? - 09/10/05 04:13 PM
try this

Code:

on *:TEXT:*:#: {
  if (! isin $1) {
    %active.chan = $replace($chan,$chr(291),h) $+ cmd
    %active2.chan = %active.chan $+ .hsh
  }
  if ($1 == !listcmds) {
    var %listcmds.inc = 1
    msg $nick Listing Commands...
    while (%listcmds.inc &lt;= $hget(%active.chan,0).item) {
      msg $nick $hget(%active.chan,%listcmds.inc).item
      inc %listcmds.inc
    }
  }
  if ($1 == !Addcmd) &amp;&amp; (! == $left($2,+1)) {
    if ($2 == $hfind(%active.chan,$2)) { msg $chan $nick you cannot add that command to file it already exist | halt }
    else { hadd %active.chan $2 $3-
      hsave %active.chan %active.chan $+ .hsh
      msg $chan $nick $+ , I added Command ( $+ $2 $+ ) to file.
    }
  }
  if ($1 == !Delcmd) &amp;&amp; (! == $left($2,+1)) {
    hdel %active.chan $2
    hsave %active.chan %active.chan $+ .hsh
  }
  if (! isin $1) {
    var %hreplace = $hget(%active.chan,$1)
    if (hnick isin %hreplace) &amp;&amp; (hchan isin %hreplace) {
      msg $chan $replace(%hreplace,hnick,$2,hchan,$chan)
    }
    elseif (hnick isin %hreplace) {
      msg $chan $replace(%hreplace,hnick,$2)
    }
    elseif (hchan isin %hreplace) {
      msg $chan $replace(%hreplace,hchan,$chan)
    }
    else { msg $chan %hreplace }
  }
}

alias cmdlist {
  var %hchan = $replace($active,$chr(291),h) $+ cmd
  hmake %hchan $?="How many items? 30 is average"
  hsave %hchan %hchan $+ .hsh
}

Posted By: David_James Re: Can anyone help me with this? - 09/10/05 06:14 PM
Well, it seems to work perfectly. The problem is on !listcmds and !delcmd. May you add more condition like. If there is no cmds in list, when user type !listcmds, it will say ' Cmds list is empty. ' And !delcmd, if use type !delcmd, if $2 is not in list, it will say ' $2 is not in the list '. And only user have mode ~,& and @ can use command !addcmd or !delcmd. Millions thanks to you Lpfix5.
Posted By: Lpfix5 Re: Can anyone help me with this? - 09/10/05 08:04 PM
Code:
 

slight code edit

on *:TEXT:*:#: {
  if (! isin $1) {
    %active.chan = $replace($chan,$chr(291),h) $+ cmd
    %active2.chan = %active.chan $+ .hsh
  }
  if ($1 == !listcmds) {
    if ($hget(%active.chan,0).item == 0) { msg $chan Sorry $nick $+ , no commands stored in list }
    if ($hget(%active.chan,0).item &gt;= 1) { 
      var %listcmds.inc = 1
      msg $nick Listing Commands...
      while (%listcmds.inc &lt;= $hget(%active.chan,0).item) {
        msg $nick $hget(%active.chan,%listcmds.inc).item
        inc %listcmds.inc
      }
    }
  }
  if ($nick isop $chan) {
    if ($1 == !Addcmd) &amp;&amp; (! == $left($2,+1)) {
      if ($2 == $hfind(%active.chan,$2)) { msg $chan $nick you cannot add that command to file it already exist | halt }
      else { hadd %active.chan $2 $3-
        hsave %active.chan %active.chan $+ .hsh
        msg $chan $nick $+ , I added Command ( $+ $2 $+ ) to file.
      }
    }
    if ($1 == !Delcmd) &amp;&amp; (! == $left($2,+1)) {
      hdel %active.chan $2
      hsave %active.chan %active.chan $+ .hsh
    }
  }
  elseif ($nick !isop) { msg $chan You cannot use !addcmd or !Delcmd }
  if ($1 == $hget(%active.chan,$1)) {
    var %hreplace = $hget(%active.chan,$1)
    if (hnick isin %hreplace) &amp;&amp; (hchan isin %hreplace) {
      msg $chan $replace(%hreplace,hnick,$2,hchan,$chan)
    }
    elseif (hnick isin %hreplace) {
      msg $chan $replace(%hreplace,hnick,$2)
    }
    elseif (hchan isin %hreplace) {
      msg $chan $replace(%hreplace,hchan,$chan)
    }
    else { msg $chan %hreplace }
  }
}

alias cmdlist {
  var %hchan = $replace($active,$chr(291),h) $+ cmd
  hmake %hchan $?="How many items? 30 is average"
  hsave %hchan %hchan $+ .hsh
}


Posted By: David_James Re: Can anyone help me with this? - 10/10/05 02:12 AM
Here I've got some errrors:
If a nick holding OP status does !addcmd or !delcmd, it's working fine. Example:
<@David_James> !addcmd !Test Test
<BotComs> David_James, I added Command (!Test) to file.
but when I type !Test, it didn't work. frown

Another error is that, when a regular user try to type !addcmd or !delcmd it showed message like this: * /if: invalid format (line 61, script12.ini)
Posted By: Lpfix5 Re: Can anyone help me with this? - 10/10/05 04:15 AM
im feeling a bit better i think a little now i noticed a few errors im my original script try that for now fixes current errors your talking about

Code:

on *:TEXT:*:#: {
  if (! isin $1) {
    %active.chan = $replace($chan,$chr(291),h) $+ cmd
    %active2.chan = %active.chan $+ .hsh
  }
  if ($1 == !listcmds) {
    if ($hget(%active.chan,0).item == 0) { msg $chan Sorry $nick $+ , no commands stored in list }
    if ($hget(%active.chan,0).item &gt;= 1) { 
      var %listcmds.inc = 1
      msg $nick Listing Commands...
      while (%listcmds.inc &lt;= $hget(%active.chan,0).item) {
        msg $nick $hget(%active.chan,%listcmds.inc).item
        inc %listcmds.inc
      }
    }
  }
  if ($1 == !Addcmd) &amp;&amp; (! == $left($2,+1)) {
    if ($nick isop $chan) &amp;&amp; ($2 == $hfind(%active.chan,$2)) { msg $chan $nick you cannot add that command to file it already exist | halt }
    elseif ($nick isop $chan) { hadd %active.chan $2 $3-
      hsave %active.chan %active.chan $+ .hsh
      msg $chan $nick $+ , I added Command ( $+ $2 $+ ) to file.
    }
    else { msg $chan Unfortunently $nick $+ , you cannot add $2 to file you have 40% access to this script. }
  }
  if ($1 == !Delcmd) &amp;&amp; (! == $left($2,+1)) {
    if ($nick isop $chan) {
      hdel %active.chan $2
      hsave %active.chan %active.chan $+ .hsh
      msg $chan I have removed ( $+ $2 $+ ) from file.
    }
    elseif ($2 == $hfind(%active.chan,$2)) { msg $chan Unfortunently $nick $+ , You cannot remove $2 from file you have 40% access to script }
  }
  if ($hget(%active.chan,$1)) {
    var %hreplace = $hget(%active.chan,$1)
    if (hnick isin %hreplace) &amp;&amp; (hchan isin %hreplace) {
      msg $chan $replace(%hreplace,hnick,$2,hchan,$chan)
    }
    elseif (hnick isin %hreplace) {
      msg $chan $replace(%hreplace,hnick,$2)
    }
    elseif (hchan isin %hreplace) {
      msg $chan $replace(%hreplace,hchan,$chan)
    }
    else { msg $chan %hreplace }
  }
}

alias cmdlist {
  var %hchan = $replace($active,$chr(291),h) $+ cmd
  hmake %hchan $?="How many items? 30 is average"
  hsave %hchan %hchan $+ .hsh
}

Posted By: David_James Re: Can anyone help me with this? - 10/10/05 10:06 AM
It works perfectly... Millions thanks for you, Lipfix5. smile
Posted By: Lpfix5 Re: Can anyone help me with this? - 10/10/05 01:04 PM
No problem thats what im here for.

also to cause less headaches a bit,.. put this script in also with that

basically scans and sees if the file exist if so it loads it

Code:

on 1:JOIN:#: {
var %join.scan = $replace($chan,$chr(35),h) $+ cmd.hsh
if ($nick == $me) &amp;&amp; ($exists(%join.scan) == $true) {
hmake %join.scan 30
hload %join.scan %join.scan $+ cmd.hsh
}
else { echo -a Did not find %join.scan $+ cmd.hsh on file }
}

Posted By: David_James Re: Can anyone help me with this? - 10/10/05 01:30 PM
Er... a little more problem here. I added a cmd below:
<@David_James> !addaction !wb $nick Welcome hnick to hchan.
Now I tried to use !wb Funkie:
<@David_James> !wb Funkie
My bot replied:
<MyBot> $nick Welcome Funkie to #funkie.

Forexample: If I use !wb Funkie, is there anyway to make it change to ' David_James Welcome Funkie to #funkie. '
Forexample:
<nickA> !wb David_James
<MyBots> nickA Welcome David_James to Channel.
Posted By: Lpfix5 Re: Can anyone help me with this? - 10/10/05 02:03 PM
Easy... just remember the $replace functions...

added new function hname which ='s $nick of person who original does the command

Code:

on *:TEXT:*:#: {
  if (! isin $1) {
    %active.chan = $replace($chan,$chr(291),h) $+ cmd
    %active2.chan = %active.chan $+ .hsh
  }
  if ($1 == !listcmds) {
    if ($hget(%active.chan,0).item == 0) { msg $chan Sorry $nick $+ , no commands stored in list }
    if ($hget(%active.chan,0).item &gt;= 1) { 
      var %listcmds.inc = 1
      msg $nick Listing Commands...
      while (%listcmds.inc &lt;= $hget(%active.chan,0).item) {
        msg $nick $hget(%active.chan,%listcmds.inc).item
        inc %listcmds.inc
      }
    }
  }
  if ($1 == !Addcmd) &amp;&amp; (! == $left($2,+1)) {
    if ($nick isop $chan) &amp;&amp; ($2 == $hfind(%active.chan,$2)) { msg $chan $nick you cannot add that command to file it already exist | halt }
    elseif ($nick isop $chan) { hadd %active.chan $2 $3-
      hsave %active.chan %active.chan $+ .hsh
      msg $chan $nick $+ , I added Command ( $+ $2 $+ ) to file.
    }
    else { msg $chan Unfortunently $nick $+ , you cannot add $2 to file you have 40% access to this script. }
  }
  if ($1 == !Delcmd) &amp;&amp; (! == $left($2,+1)) {
    if ($nick isop $chan) {
      hdel %active.chan $2
      hsave %active.chan %active.chan $+ .hsh
      msg $chan I have removed ( $+ $2 $+ ) from file.
    }
    elseif ($2 == $hfind(%active.chan,$2)) { msg $chan Unfortunently $nick $+ , You cannot remove $2 from file you have 40% access to script }
  }
  if ($hget(%active.chan,$1)) {
    var %hreplace = $hget(%active.chan,$1)
    if (hnick isin %hreplace) &amp;&amp; (hchan isin %hreplace) {
      msg $chan $replace(%hreplace,hnick,$2,hchan,$chan[color:red],hname,$nick[/color])
    }
    elseif (hnick isin %hreplace) {
      msg $chan $replace(%hreplace,hnick,$2)
    }
    elseif (hchan isin %hreplace) {
      msg $chan $replace(%hreplace,hchan,$chan)
    }
   [color:red] elseif (hname isin %hreplace) {
      msg $chan $replace(%hreplace,hname,$nick)
    }[/color]
    else { msg $chan %hreplace }
  }
}

alias cmdlist {
  var %hchan = $replace($active,$chr(291),h) $+ cmd
  hmake %hchan $?="How many items? 30 is average"
  hsave %hchan %hchan $+ .hsh
}

Posted By: David_James Re: Can anyone help me with this? - 10/10/05 03:13 PM
Well, it is not working.
-------------
<@David_James> !addcmd !hi hname says hi to hnick.
<BotComs> David_James, I added Command (!hi) to file.
<CuTiE_KapEr> !hi David_James
<BotComs> hname says hi to David_James.
-------------
It didn't replace hname to CuTie_KapEr. frown
Posted By: Riamus2 Re: Can anyone help me with this? - 10/10/05 03:29 PM
Heh... it's those elseif's causing the problem. Change:

Code:
if ($hget(%active.chan,$1)) {
  var %hreplace = $hget(%active.chan,$1)
  if (hnick isin %hreplace) &amp;&amp; (hchan isin %hreplace) {
    msg $chan $replace(%hreplace,hnick,$2,hchan,$chan,hname,$nick)
  }
  elseif (hnick isin %hreplace) {
    msg $chan $replace(%hreplace,hnick,$2)
  }
  elseif (hchan isin %hreplace) {
    msg $chan $replace(%hreplace,hchan,$chan)
  }
  elseif (hname isin %hreplace) {
    msg $chan $replace(%hreplace,hname,$nick)
  }
  else { msg $chan %hreplace }
}


to:

Code:
if ($hget(%active.chan,$1)) {
  var %hreplace = $replacex($hget(%active.chan,$1),hnick,$2,hchan,$chan,hname,$nick)
  msg $chan %hreplace
}


Or, get rid of the variable altogether:

Code:
if ($hget(%active.chan,$1)) {
  msg $chan $replacex($hget(%active.chan,$1),hnick,$2,hchan,$chan,hname,$nick)
}
Posted By: David_James Re: Can anyone help me with this? - 10/10/05 04:38 PM
Thanks Riamus. It works perfectly. smile And thanks Lpfix5 too. Too much job for you. smile
Posted By: David_James Re: Can anyone help me with this? - 10/10/05 08:20 PM
Well, the remote seems to work perfectly, but the problem is that, when I restart my bot and I typed !listcmds it showed me There Aren't Any Cmd Restored even there are cmds were added in that channel already. After that, I tried to add cmds again, and it showed me /hadd: no such table 'h4ucmd', but table for this channel were created already and even stored some cmds too. frown
Posted By: Riamus2 Re: Can anyone help me with this? - 10/10/05 09:04 PM
Make sure you have a HLOAD in the script you're using. In 2 spots above, there were HLOAD mentioned, but not in all replies, so you need to make sure you included HLOAD. That's what loads your hash table. Note that you also need HMAKE before using HLOAD.
Posted By: Lpfix5 Re: Can anyone help me with this? - 10/10/05 09:27 PM
yeah I did mention it on top when i said you might want to include this also

on Join blah blah.. where i showed you a on join script with hmake and hload laugh

sorry about the elseif's again like i was saying yesterday im not feeling too well these days i got a dang head cold, as well has stuffed sinus and throath congestition

sorry about making you go back in fourth in the testing and all, i did attempt to test it but i didnt look at all causes before releasing it and the last edit i did i just real quick edited the current script
Posted By: David_James Re: Can anyone help me with this? - 11/10/05 01:02 AM
Here are errors I've got:
/hload: unable to open 'C:\Program Files\mIRC\hchocolatecmd.hshcmd.hsh' (line 56, script12.ini)
Did not find hchocolatecmd.hshcmd.hsh on file
Posted By: Lpfix5 Re: Can anyone help me with this? - 11/10/05 02:33 AM
my mistake dude i already evaluated cmd.hsh lemme fix it real quick sorry the reason why it was loading like that i added $+ cmd.hsh too many times. but everything is fixed here guaranteed

Code:

on 1:JOIN:#: {

var %join.scan = $replace($chan,$chr(35),h)
var %join.scan2 =  %join.scan $+ cmd.hsh

if ($nick == $me) &amp;&amp; ($exists(%join.scan2) == $true) {

hmake %join.scan 30

hload %join.scan %join.scan2

}

else { echo -a Did not find %join.scan2 on file }

}

Posted By: David_James Re: Can anyone help me with this? - 11/10/05 03:06 AM
Here it is my original code. I stil got same errors. frown
Code:
;Snippet from http://www.mirc.co.uk
;By Lpfix5 and Riamus2

on *:TEXT:*:#: {
  if (! isin $1) {
    %active.chan = $replace($chan,$chr(291),h) $+ cmd
    %active2.chan = %active.chan $+ .hsh
  }
  if ($1 == !listaction) {
    if ($hget(%active.chan,0).item == 0) { notice $nick Sorry $nick $+ , There aren't any actions stored. }
    if ($hget(%active.chan,0).item &gt;= 1) { 
      var %listcmds.inc = 1
      while (%listcmds.inc &lt;= $hget(%active.chan,0).item) {
        notice $nick $hget(%active.chan,%listcmds.inc).item
        inc %listcmds.inc
      }
    }
  }
  if ($1 == !addaction) &amp;&amp; (! == $left($2,+1)) {
    if ($nick isop $chan) &amp;&amp; ($2 == $hfind(%active.chan,$2)) { notice $nick you cannot add  $2  to file it's already exist. | halt }
    elseif ($nick isop $chan) { hadd %active.chan $2 $3-
      hsave %active.chan %active.chan $+ .hsh
      notice $nick  $2  has been stored in file successfully.
    }
    else { notice $nick Sorry $nick $+ , you don't have enough permission to add  $2  into file. }
  }
  if ($1 == !delaction) &amp;&amp; (! == $left($2,+1)) {
    if ($nick isop $chan) {
      hdel %active.chan $2
      hsave %active.chan %active.chan $+ .hsh
      notice $nick  $2  has been removed from file successfully.
    }
    elseif ($2 == $hfind(%active.chan,$2)) { notice $nick Sorry $nick $+ , You don't have enough permission to del  $2  from file. }
  }
  if ($hget(%active.chan,$1)) {

    var %hreplace = $replacex($hget(%active.chan,$1),hnick,$2,hchan,$chan,hname,$nick)

    msg $chan %hreplace

  }

}

alias cmdlist {
  var %hchan = $replace($active,$chr(291),h) $+ cmd
  hmake %hchan $?="How many items? 30 is average"
  hsave %hchan %hchan $+ .hsh
}

on 1:JOIN:#: {

  var %join.scan = $replace($chan,$chr(35),h)
  var %join.scan2 =  %join.scan $+ cmd.hsh

  if ($nick == $me) &amp;&amp; ($exists(%join.scan2) == $true) {

    hmake %join.scan 30

    hload %join.scan %join.scan2

  }

  else { echo -a Did not find %join.scan2 on file }

}

 
Posted By: Lpfix5 Re: Can anyone help me with this? - 11/10/05 03:24 AM
AGAIN another error sheesh i dont know whats up i think this cold is giving me braindead syndrome

i tested this one 3 times to make sure now it should work successfully if not ill tear my hair out

Code:

on *:TEXT:*:#: {
  if (! isin $1) {
    %active.chan = $replace($chan,$chr(291),h) $+ cmd
    %active2.chan = %active.chan $+ .hsh
  }
  if ($1 == !listaction) {
    if ($hget(%active.chan,0).item == 0) { notice $nick Sorry $nick $+ , There aren't any actions stored. }
    if ($hget(%active.chan,0).item &gt;= 1) { 
      var %listcmds.inc = 1
      while (%listcmds.inc &lt;= $hget(%active.chan,0).item) {
        notice $nick $hget(%active.chan,%listcmds.inc).item
        inc %listcmds.inc
      }
    }
  }
  if ($1 == !addaction) &amp;&amp; (! == $left($2,+1)) {
    if ($nick isop $chan) &amp;&amp; ($2 == $hfind(%active.chan,$2)) { notice $nick you cannot add  $2  to file it's already exist. | halt }
    elseif ($nick isop $chan) { hadd %active.chan $2 $3-
      hsave %active.chan %active.chan $+ .hsh
      notice $nick  $2  has been stored in file successfully.
    }
    else { notice $nick Sorry $nick $+ , you don't have enough permission to add  $2  into file. }
  }
  if ($1 == !delaction) &amp;&amp; (! == $left($2,+1)) {
    if ($nick isop $chan) {
      hdel %active.chan $2
      hsave %active.chan %active.chan $+ .hsh
      notice $nick  $2  has been removed from file successfully.
    }
    elseif ($2 == $hfind(%active.chan,$2)) { notice $nick Sorry $nick $+ , You don't have enough permission to del  $2  from file. }
  }
  if ($hget(%active.chan,$1)) {

    var %hreplace = $replacex($hget(%active.chan,$1),hnick,$2,hchan,$chan,hname,$nick)

    msg $chan %hreplace

  }

}

alias cmdlist {
  var %hchan = $replace($active,$chr(291),h) $+ cmd
  hmake %hchan $?="How many items? 30 is average"
  hsave %hchan %hchan $+ .hsh
}

on 1:JOIN:#: {
  var %join.scan = $replace($chan,$chr(35),h) $+ cmd
  var %join.scan2 =  %join.scan $+ .hsh
  if ($nick == $me) &amp;&amp; ($exists(%join.scan2) == $true) {
    hmake %join.scan 30
    hload %join.scan %join.scan2
  }
  else { echo -a Did not find %join.scan2 on file }
}


Posted By: David_James Re: Can anyone help me with this? - 11/10/05 04:03 AM
Hehe... You will never ever tear your hair out. It works without any errors. You guys are briiliants. smile
Posted By: Lpfix5 Re: Can anyone help me with this? - 11/10/05 04:08 AM
Sweet i guess i get to style and comb my hair every day still opposed to the cold days up here
© mIRC Discussion Forums