Author Topic: LUA 5 scripts for DCH++  (Read 4940 times)

0 Members and 1 Guest are viewing this topic.

Offline Saivert

  • Junior Member
  • **
  • Posts: 15
  • Karma: +0/-0
LUA 5 scripts for DCH++
« 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.


PtokaX forum

LUA 5 scripts for DCH++
« on: 21 April, 2005, 22:33:11 »

Herodes

  • Guest
(No subject)
« Reply #1 on: 22 April, 2005, 00:59:36 »
Quote
Originally 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.. I wish you better luck there

Offline Sedulus

  • Member
  • ***
  • Posts: 43
  • Karma: +0/-0
(No subject)
« Reply #2 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

Offline Saivert

  • Junior Member
  • **
  • Posts: 15
  • Karma: +0/-0
But does PtokaX support the same?
« Reply #3 on: 22 April, 2005, 17:32:22 »
Does PtokaX support getHubVersion() too?

You mean that I can write something like this:

Code: [Select]
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:
Code: [Select]






« Last Edit: 22 April, 2005, 17:40:16 by Saivert »

Herodes

  • Guest
(No subject)
« Reply #4 on: 22 April, 2005, 17:39:37 »
Quote
Originally posted by Saivert
Does PtokaX support getHubVersion() too?

You mean that I can write something like this:

Quote
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.
no PtokaX dont support getHubVersion()
but that helps the situation too..
Code: [Select]
function hubIsPtokaX()
if pcall(getHubVersion()) then
return nil;
end;
return true
end
« Last Edit: 22 April, 2005, 17:44:23 by Herodes »

Herodes

  • Guest
(No subject)
« Reply #5 on: 22 April, 2005, 17:46:20 »
Quote
Originally 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:
Code: [Select]






once again .. this forum couldn't care less imo... it is about PtokaX .. go to DCH++ forum to discuss this.

Offline Sedulus

  • Member
  • ***
  • Posts: 43
  • Karma: +0/-0
(No subject)
« Reply #6 on: 24 April, 2005, 18:54:38 »
Quote
Originally posted by Herodes
Code: [Select]
function hubIsPtokaX()
if pcall(getHubVersion()) then
return nil;
end;
return true
end

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

it would be nice if ptokax did support getHubVersion though...

Offline ??????Hawk??????

  • Emperor
  • **
  • Posts: 1 044
  • Karma: +12/-2
    • Leeds Laptop Repairs
(No subject)
« Reply #7 on: 24 April, 2005, 19:51:03 »
Code: [Select]
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
« Last Edit: 24 April, 2005, 19:51:19 by ??????Hawk?????? »

Offline Sedulus

  • Member
  • ***
  • Posts: 43
  • Karma: +0/-0
(No subject)
« Reply #8 on: 24 April, 2005, 21:10:59 »
=)

Offline Saivert

  • Junior Member
  • **
  • Posts: 15
  • Karma: +0/-0
We need a fast an stable hub
« Reply #9 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?

Offline PPK

  • Administrator
  • Emperor
  • *****
  • Posts: 1 481
  • Karma: +209/-22
  • PtokaX developer
(No subject)
« Reply #10 on: 25 April, 2005, 13:06:15 »
Quote
Originally 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
"Most of you are familiar with the virtues of a programmer. There are three, of course: laziness, impatience, and hubris." - Larry Wall

Herodes

  • Guest
(No subject)
« Reply #11 on: 25 April, 2005, 14:44:12 »
Quote
Originally 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.

Offline GeceBekcisi

  • Scripter
  • Lord
  • ******
  • Posts: 311
  • Karma: +10/-1
  • You don't need eyes to see, you need vision..
(No subject)
« Reply #12 on: 25 April, 2005, 14:59:57 »
Quote
Originally posted by Saivert
...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)...
Quote
Originally posted by Quattro
...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
« Last Edit: 25 April, 2005, 17:46:24 by GeceBekcisi »
Do you need an advanced user handling script? Download UserBekcisi today (Latest Edit)
Features: User + ISP + GeoIP database, user info + share checking and many more...

Offline plop

  • Forum God
  • ****
  • Posts: 2 464
  • Karma: +37/-0
(No subject)
« Reply #13 on: 25 April, 2005, 17:37:59 »
Code: [Select]

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

PtokaX forum

(No subject)
« Reply #13 on: 25 April, 2005, 17:37:59 »