Garbage ?
 

News:

29 December 2022 - PtokaX 0.5.3.0 (20th anniversary edition) released...
11 April 2017 - PtokaX 0.5.2.2 released...
8 April 2015 Anti child and anti pedo pr0n scripts are not allowed anymore on this board!
28 September 2015 - PtokaX 0.5.2.1 for Windows 10 IoT released...
3 September 2015 - PtokaX 0.5.2.1 released...
16 August 2015 - PtokaX 0.5.2.0 released...
1 August 2015 - Crowdfunding for ADC protocol support in PtokaX ended. Clearly nobody want ADC support...
30 June 2015 - PtokaX 0.5.1.0 released...
30 April 2015 Crowdfunding for ADC protocol support in PtokaX
26 April 2015 New support hub!
20 February 2015 - PtokaX 0.5.0.3 released...
13 April 2014 - PtokaX 0.5.0.2 released...
23 March 2014 - PtokaX testing version 0.5.0.1 build 454 is available.
04 March 2014 - PtokaX.org sites were temporary down because of DDOS attacks and issues with hosting service provider.

Main Menu

Garbage ?

Started by Intel, 16 March, 2004, 23:32:14

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Intel

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
Punnakku

NightLitch

try something like this:

function Clear(Table)
	Table = nil
	Table = {}
	collectgarbage() 
	flush()
end
//NL

Intel

that was a quick answer...thanks buddy :O
Punnakku

Intel

but how to clear it ?
Punnakku

NightLitch

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
//NL

Intel

I am really empty of ideas,  : (
Punnakku

[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?
Owner of FunnyHub
 
Funyhub.no-ip.info
       Forum Master of


NightLitch

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
//NL

NightLitch

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
//NL

NotRabidWombat

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


I like childish behavior. Maybe this post will be deleted next.

[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
Owner of FunnyHub
 
Funyhub.no-ip.info
       Forum Master of


plop

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
http://www.plop.nl lua scripts/howto\'s.
http://www.thegoldenangel.net
http://www.vikingshub.com
http://www.lua.org

>>----> he who fights hatred with hatred, drives the spreading of hatred <----<<

SMF spam blocked by CleanTalk