PtokaX forum

Development Section => LUA & PtokaX-Scripting-Interface => Topic started by: Saivert on 21 April, 2005, 22:33:11

Title: LUA 5 scripts for DCH++
Post by: Saivert on 21 April, 2005, 22:33:11
I'm missing a topic for DCH++ and LUA 5 scripts so I though I create one here.

I want this thread to be a place where people can discuss how to rewrite LUA 4/5 scripts for PtokaX so they work in DCH++.

NOTE: DCH++ does not have native support for LUA language but uses a LuaScript plugin for it.

Title:
Post by: Herodes on 22 April, 2005, 00:59:36
QuoteOriginally posted by Saivert
I'm missing a topic for DCH++ and LUA 5 scripts so I though I create one here.

I want this thread to be a place where people can discuss how to rewrite LUA 4/5 scripts for PtokaX so they work in DCH++.

NOTE: DCH++ does not have native support for LUA language but uses a LuaScript plugin for it.
PtokaX and DCH are not using the same functions that lua uses in the scripts to interact with the hubsoft. ( different API ). so it is impossible as far as i know to write a complex script or heavily-depended-on-API script that runs on both.
also please refer to the dch++ forum (http://dchpp.freebb.com/).. I wish you better luck there
Title:
Post by: Sedulus on 22 April, 2005, 06:44:10
actually, DCH++ supports the getHubVersion() function returning hubname,hubversion. so you could build a wrapper and write compatible scripts, as long as you only need features that both hubs provide.

Quote[06:42:03] +lua a,b = getHubVersion() ; dchpp.getClient("Sedulus"):hubMessage(a..","..b)
[06:42:03] DCH++,1
Title: But does PtokaX support the same?
Post by: Saivert on 22 April, 2005, 17:32:22
Does PtokaX support getHubVersion() too?

You mean that I can write something like this:

a,b = getHubVersion()
if a == "DCH++" then
  --do DCH++ stuff here...
else
  --do PtokaX stuff here...
end

Or one can write a PtokaX layer into the LuaScript plugin (or as a new plugin based on LuaScript) that makes PtokaX scripts run on DCH++ unmodified. PtokaX LUA scripts could then be loaded in it's own context.

Here's my idea of a LuaScript.xml fragement:






Title:
Post by: Herodes on 22 April, 2005, 17:39:37
QuoteOriginally posted by Saivert
Does PtokaX support getHubVersion() too?

You mean that I can write something like this:

Quotea,b = getHubVersion()
if a == "DCH++" then
  --do DCH++ stuff here...
else
  --do PtokaX stuff here...
end

Or one can write a PtokaX layer into the LuaScript plugin (or as a new plugin based on LuaScript) that makes PtokaX scripts run on DCH++ unmodified. PtokaX LUA scripts could then be loaded in it's own context.
no PtokaX dont support getHubVersion()
but that helps the situation too..
function hubIsPtokaX()
if pcall(getHubVersion()) then
return nil;
end;
return true
end
Title:
Post by: Herodes on 22 April, 2005, 17:46:20
QuoteOriginally posted by Saivert
Or one can write a PtokaX layer into the LuaScript plugin (or as a new plugin based on LuaScript) that makes PtokaX scripts run on DCH++ unmodified. PtokaX LUA scripts could then be loaded in it's own context.

Here's my idea of a LuaScript.xml fragement:






once again .. this forum couldn't care less imo... it is about PtokaX .. go to DCH++ forum to discuss this.
Title:
Post by: Sedulus on 24 April, 2005, 18:54:38
QuoteOriginally posted by Herodes
function hubIsPtokaX()
if pcall(getHubVersion()) then
return nil;
end;
return true
end

I'd go with:
if getHubVersion and getHubVersion() == "DCH++" then
  // dch++
else
  // fallback, assume ptokax
end

it would be nice if ptokax did support getHubVersion though...
Title:
Post by: ??????Hawk?????? on 24 April, 2005, 19:51:03
if getHubVersion and getHubVersion() == "DCH++" then
function dchpp.userConnected( client )
client:hubMessage( "http://www.ptokax.org <---------Click Here")
end
else
OpConnected = NewUserConnected
function NewUserConnected(curUser)
curUser.SendData(" You Saw the Light ! ! ! ")
end
end



 :P  :P  :P  :P  :P  :P  :P
Title:
Post by: Sedulus on 24 April, 2005, 21:10:59
=)
Title: We need a fast an stable hub
Post by: Saivert on 25 April, 2005, 12:25:29
We need a fast an stable hub and DCH++ is one such hub.
PtokaX can be very hungry and eat up a lot of resources (uneccessary) even with few users connected.

I just wanted to discuss LUA scripts running on DCH++ as I couldn't find any other fourms where they discussed LUA scripts for hub softwares.

So, sorry if you guys feel all warm and fuzzy about PtokaX and don't give a shit about DCH++.

To Sedulus: Why did you smile in the post after what Hawk just wrote (the stupid script). Do you like PtokaX?
Title:
Post by: PPK on 25 April, 2005, 13:06:15
QuoteOriginally posted by Saivert
We need a fast an stable hub and DCH++ is one such hub.
PtokaX can be very hungry and eat up a lot of resources (uneccessary) even with few users connected.
Why do you lie here  ?(
DCH++ use more badwith and more cpu than PtokaX :]
DCH++ is very bad and creators know it, that is why is here no real binary release :P
Title:
Post by: Herodes on 25 April, 2005, 14:44:12
QuoteOriginally posted by Saivert
To Sedulus: Why did you smile in the post after what Hawk just wrote (the stupid script). Do you like PtokaX?
Having a sense of humor doesn't relate directly to any matter of opinion.
Title:
Post by: GeceBekcisi on 25 April, 2005, 14:59:57
QuoteOriginally posted by Saivert (http://11.freebb.com/viewtopic.php?t=44&freebb=dchpp)
...DCH++ is also not a mainstream hub software. It is for us who likes to code and hack things. If you want a n00b hubsoft, then go for YnHub or even Neo-Modus DirectConnect hub (v1.00000)...
QuoteOriginally posted by Quattro (http://11.freebb.com/viewtopic.php?t=44&freebb=dchpp)
...Don't forget PtokaX...

Why needing to use irrogating sentences? There are facts in computers' world. If a software uses more bandwitdh under same conditions, it surely does; there can't be anything uncertain about this. If you worry which one is better, prepare to of them with same scripts or without scripts and run on the same system with same count of users then please post your results here.

Regards.
GeceBekcisi
Title:
Post by: plop on 25 April, 2005, 17:37:59

------------------------------------------------------------
Current stats:
------------------------------------------------------------
Version: PtokaX DC Hub 0.3.3.0 build 17.03 [debug] built on Apr 24 2005 01:20:52
Uptime: 1 days, 7 hours, 5 minutes
Users (Max/Actual Peak (Max Peak)/Logged) : 50 / 32 (40) / 31
Chat messages: 1256 x
Unknown commands: 0 x
PM commands: 49 x
Key commands: 147 x
Supports commands: 158 x
MyINFO commands: 1171 x
ValidateNick commands: 115 x
GetINFO commands: 0 x
Password commands: 103 x
Version commands: 103 x
UserIP commands: 968 x
GetNickList commands: 147 x
Search commands: 2335 x
SR commands: 48 x
CTM commands: 1216 x
RevCTM commands: 3 x
BotINFO commands: 0 x
------------------------------------------------------------
CPU usage (60 seconds average): 0.00%
CPU time: 0:00:28
Mem usage (Old style): 3812 kB
Mem usage (Peak): 7.23 MB (11.45 MB)
VM size (Peak): 9.54 MB (10.00 MB)
------------------------------------------------------------
SendRests (Peak): 0 (1)
RecvRests (Peak): 0 (0)
SendBytes: 8.94 MB
RecvBytes: 463.40 kB
running on a p3 733 with 512Mb, 8 scripts (1 uses 1.1MB, the others from 60 to 120kb)

plop