mIRC Home    About    Download    Register    News    Help

Print Thread
#160735 30/09/06 12:54 AM
Joined: Aug 2006
Posts: 469
G
Garou Offline OP
Fjord artisan
OP Offline
Fjord artisan
G
Joined: Aug 2006
Posts: 469
Why wont it save or load on start, exit and disconnect ??

on @*:unban:#: {
if (%sticky.ban == off || !%sticky.ban) { return }
if ($hget($chan,$banmask) && $nick != $me) {
mode # +b $banmask
}
}
alias MakeHash {
hmake $1 100
if ($isfile($1 $+ .hsh)) {
hload $1 $+ .hsh
}
}
alias AddBan {
if (!$hget($chan,0).item) {
MakeHash $chan
}
hadd $chan $$?="Enter banmask or nick" $ctime
hsave $chan $chan $+ .hsh
}
menu nicklist {
-
Sticky Ban Settings
.Add Sticky Ban:AddBan
.-
.Rem Sticky Ban:hdel $chan $$?+"Enter banmask or nick"
.-
.View Sticky Ban: .hsave -o $chan $chan $+ .hsh | run $chan $+ .hsh
.-
.Clear Sticky Ban: .hfree $chan | $iif($exists($chan $+ .hsh),remove $chan $+ .hsh)
-
}

#160736 30/09/06 12:57 AM
Joined: Apr 2006
Posts: 464
O
Fjord artisan
Offline
Fjord artisan
O
Joined: Apr 2006
Posts: 464
You don't have any of those events specified!

on:START:
on:EXIT:

etc....

#160737 30/09/06 12:59 AM
Joined: Aug 2006
Posts: 469
G
Garou Offline OP
Fjord artisan
OP Offline
Fjord artisan
G
Joined: Aug 2006
Posts: 469
How and where do I add those events in the code?

#160738 30/09/06 01:21 AM
Joined: Apr 2006
Posts: 464
O
Fjord artisan
Offline
Fjord artisan
O
Joined: Apr 2006
Posts: 464
No idea, it's difficult because every channel seems to have its own hash file.

Give it time, someone will be able to answer.

#160739 30/09/06 01:23 AM
Joined: Aug 2006
Posts: 469
G
Garou Offline OP
Fjord artisan
OP Offline
Fjord artisan
G
Joined: Aug 2006
Posts: 469
Its ok if you can make it the same for all channels I am in.

#160740 30/09/06 03:21 AM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Add this to your current code
Code:
on me:*:join:#:{
makehash $chan
}
on *:exit:{
savehash
}
on *:disconnect:{
savehash
}
alias savehash {
var %a = 1, %b = $hget(0)
while %a <= %b {
.hsave -o $hget(%a) $hget(%a) $+ .hsh
inc %a
}
}
  

#160741 30/09/06 03:22 AM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
What isn't working? The script you have saves the hash table anytime you change the hash table, which is plenty. It also loads it anytime you use it... no need to load them when starting mIRC.


Invision Support
#Invision on irc.irchighway.net
#160742 30/09/06 03:25 AM
Joined: Aug 2006
Posts: 469
G
Garou Offline OP
Fjord artisan
OP Offline
Fjord artisan
G
Joined: Aug 2006
Posts: 469
hehe it save all my script hash in my mirc folder ??

#160743 30/09/06 03:27 AM
Joined: Aug 2006
Posts: 469
G
Garou Offline OP
Fjord artisan
OP Offline
Fjord artisan
G
Joined: Aug 2006
Posts: 469
Riamus2 the problem I get when I disc it wont reload whats already save.
I get these error if i want to add or view after I reconnected

* /hload: insufficient parameters (line 10, dialog48.op)

Last edited by Garou; 30/09/06 03:34 AM.
#160744 30/09/06 03:36 AM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Ok, so it's the View that is the problem... just include this in the View menu command (before anything else):
Code:
.View Sticky Ban: if (!$hget($chan,0).item) { MakeHash $chan }  | .hsave -o $chan $chan $+ .hsh | run $chan $+ .hsh


Invision Support
#Invision on irc.irchighway.net
#160745 30/09/06 03:43 AM
Joined: Aug 2006
Posts: 469
G
Garou Offline OP
Fjord artisan
OP Offline
Fjord artisan
G
Joined: Aug 2006
Posts: 469
This is the error I get on reconnect when I try to add.

/hmake: table '#opscript' exists (line 8, dialog48.op)

So I have to delete the file first from my folder before re-adding then it works fine while am online.

Last edited by Garou; 30/09/06 03:48 AM.
#160746 30/09/06 04:00 AM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Deleting a file wouldn't affect /hmake. /hmake doesn't touch files (well... not without using the auto-load option).

Reconnecting shouldn't be an issue if you don't close mIRC anyhow... the hash table is still open. That's what that error means... it means that the hash table is already created.

And since AddBan checks to see if it's created before trying to use /hmake, it shouldn't give that error at all.

*EDIT* Uh.. are you using RusselB's code mixed with mine? If so, that's where your problem is. Just use the original code and that one View fix I posted and it'll be fine. The on join in his code doesn't check to see if the hash table is loaded or not and isn't needed with this script, anyhow.

Last edited by Riamus2; 30/09/06 04:02 AM.

Invision Support
#Invision on irc.irchighway.net
#160747 30/09/06 04:05 AM
Joined: Aug 2006
Posts: 469
G
Garou Offline OP
Fjord artisan
OP Offline
Fjord artisan
G
Joined: Aug 2006
Posts: 469
I just close and reconnect mirc and I got those 2 error.

* /hload: insufficient parameters (line 10, dialog48.op)
* /hmake: table '#opscript' exists (line 8, dialog48.op)

the file is still in my folder but nothing was save in it.

#160748 30/09/06 04:16 AM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Read the EDIT above...

Oh, and there is an hload problem...

Edit line 10 to be:

hload $1 $1 $+ .hsh


Invision Support
#Invision on irc.irchighway.net
#160749 30/09/06 04:24 AM
Joined: Aug 2006
Posts: 469
G
Garou Offline OP
Fjord artisan
OP Offline
Fjord artisan
G
Joined: Aug 2006
Posts: 469
Great stuff....Thx Riamus2 all loading and saving fine now.


Link Copied to Clipboard