|
|
Joined: Aug 2006
Posts: 469
Fjord artisan
|
OP
Fjord artisan
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) - }
|
|
|
|
Joined: Apr 2006
Posts: 464
Fjord artisan
|
Fjord artisan
Joined: Apr 2006
Posts: 464 |
You don't have any of those events specified!
on:START: on:EXIT:
etc....
|
|
|
|
Joined: Aug 2006
Posts: 469
Fjord artisan
|
OP
Fjord artisan
Joined: Aug 2006
Posts: 469 |
How and where do I add those events in the code?
|
|
|
|
Joined: Apr 2006
Posts: 464
Fjord artisan
|
Fjord artisan
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.
|
|
|
|
Joined: Aug 2006
Posts: 469
Fjord artisan
|
OP
Fjord artisan
Joined: Aug 2006
Posts: 469 |
Its ok if you can make it the same for all channels I am in.
|
|
|
|
Joined: Aug 2004
Posts: 7,252
Hoopy frood
|
Hoopy frood
Joined: Aug 2004
Posts: 7,252 |
Add this to your current 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
}
}
|
|
|
|
Joined: Oct 2004
Posts: 8,330
Hoopy frood
|
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
|
|
|
|
Joined: Aug 2006
Posts: 469
Fjord artisan
|
OP
Fjord artisan
Joined: Aug 2006
Posts: 469 |
hehe it save all my script hash in my mirc folder ??
|
|
|
|
Joined: Aug 2006
Posts: 469
Fjord artisan
|
OP
Fjord artisan
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.
|
|
|
|
Joined: Oct 2004
Posts: 8,330
Hoopy frood
|
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):
.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
|
|
|
|
Joined: Aug 2006
Posts: 469
Fjord artisan
|
OP
Fjord artisan
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.
|
|
|
|
Joined: Oct 2004
Posts: 8,330
Hoopy frood
|
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
|
|
|
|
Joined: Aug 2006
Posts: 469
Fjord artisan
|
OP
Fjord artisan
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.
|
|
|
|
Joined: Oct 2004
Posts: 8,330
Hoopy frood
|
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
|
|
|
|
Joined: Aug 2006
Posts: 469
Fjord artisan
|
OP
Fjord artisan
Joined: Aug 2006
Posts: 469 |
Great stuff....Thx Riamus2 all loading and saving fine now.
|
|
|
|
|
|