Hey Guys,
I just need to clear a few things. in Ptokax Hub I see Under Advance Options... a info box which tells how much memory I use now and how much is in the garbage.. What Shall I use that Garbage info too ? And how can i reset that info to 00. I mean How can i clear the garbage.
Advance Thanks
try something like this:
function Clear(Table)
Table = nil
Table = {}
collectgarbage()
flush()
end
that was a quick answer...thanks buddy :O
but how to clear it ?
k simple,
make a command or timer and when triggerd garbage is emty.
ex:
if cmd=="!cleanmem" then
collectgarbage()
flush()
curUser:SendData(Bot,"Garbage Memory cleaned")
end
or
Nick = "YourNick"
function OnTimer()
collectgarbage()
flush()
SendToNick(Nick,Bot,"Garbage Memory cleaned")
end
only do pieces becouse know you can script a bit.
this is some solusions from me.
/NL
I am really empty of ideas, : (
hay nightlitch
i could use something like that aswel and next question is how to remove bots from that part of pkotax?
cause it happens that after i have removed a bot from scriptdir it was removed from scripteditor but not from the advanced options tab thus the bot is still showing using memory.
or would this bot take care of that also cause the bot is garbage?
QuoteOriginally posted by [NL]trucker
hay nightlitch
i could use something like that aswel and next question is how to remove bots from that part of pkotax?
cause it happens that after i have removed a bot from scriptdir it was removed from scripteditor but not from the advanced options tab thus the bot is still showing using memory.
or would this bot take care of that also cause the bot is garbage?
don't know. haven't played with this so much. or it is not to too much to play with but.. :-p
here is a simple code:
function DataArrival(user, data)
if( strsub(data, 1, 1) == "<" ) then
-- parse the command
s,e,cmd = strfind( data, "%b<>%s+(%S+)%s*")
cmd=strsub(cmd,1,strlen(cmd)-1)
if (cmd=="!cleanmem") then
collectgarbage()
flush()
user:SendData("MemClean","Garbage Memory cleaned")
end
end
end
/NL
The value you are looking at is Garbage Collector Threshold. When the memory used by the script reaches this value the garbage collector is kicked off automatically. That's the whole purpose of the garbage collector. Remove the programmer from memory management.
-NotRabidWombat
NotRabidWombat
lol
i did remove the script out of the scriptdir but it still shows in there.
and have restarted scripts several times just wanted to know if it is possiblle to remove it with some kind of script or do i need to restart hub to get rid of it.
the last option i hate as i,m running now with over 1130 users and havent restarted since :
[12:43:42] *** 9 days, 3 hrs. 40 min. and 44 sec.
so i would hate it since my last record is at 12 days ...lol
QuoteOriginally posted by [NL]trucker
NotRabidWombat
lol
i did remove the script out of the scriptdir but it still shows in there.
and have restarted scripts several times just wanted to know if it is possiblle to remove it with some kind of script or do i need to restart hub to get rid of it.
the last option i hate as i,m running now with over 1130 users and havent restarted since :
[12:43:42] *** 9 days, 3 hrs. 40 min. and 44 sec.
so i would hate it since my last record is at 12 days ...lol
this tiny script removes bot's from the userlist.
Bot = "name_of_the_bot_2_be_removed"
funtion Main()
frmHub:UnregBot(Bot)
end
but the problem you see is actualy a bug in the 0.3.3.0 beta.
the window doesn't get refreshed correct on removal of a script (i've seen 2x the same script there).
plop