cSlave 1.0 is now completly programmable!
Wanna learn lua4 for ptokax? but dont have the brains to pattern match or do anything else? Well this is for you!
And for the advanced ppl, dont be turned off, cause it also contains some super quick api resources for programing with speed and ease.
1 - Ptokax event scripting support for those scritps that return 1 to all process's, making it seem something strange is going on
-- cSlave 1.0 Demo pTokax Script
function Main()
end
function DataArrival(tUser, sData, bProcessReturned)
--SendToAll("*** " .. tUser.sName .. " -> " .. sData)
end
function NewUserConnected(tUser, bProcessReturned)
end
function OpConnected(tUser, bProcessReturned)
end
function UserDisconnected(tUser, bProcessReturned)
end
function OpDisconnected(tUser, bProcessReturned)
end
2 - Protocol event scripting to simply pass protocol to single functions for processing (very quick!)
-- Demo protocol script for cSlave 1.0
function doHello(tUser, sData)
SendToAll(tUser.sName .. " sent " .. sData)
end
regProtocolEvent("$MyNick", doHello)
3 - Command based scripting allows inputted commands (+kick someone) to be directly linked to functions that are passed tUser, tArgs.
-- Script :: Demo command event script for cSlave 1.0
--
-- Info :: This scripts adds a command to cSlaves event system called 'hello'
-- and loops through the arguments in the data
-----------------------------------------------------------
-- Dont have a clue whats happening?
-- More detailed information is in ptokax\scripts\cSlave Docs\
-- Example
-----------------------
-- Delcare a function for the command to execute
function doHello(tUser, tArgs, bProcessReturned)
-- Skips executing this command if for some strange reason your hub uses it
if bProcessReturned then return end
-- Send a message to show doHello has started executing
tUser:SendData("doHello() has started ")
-- Loop through the arguments in the tArgs table
for iIndex, sArgument in tArgs do
-- Send the index with the inputted argument
tUser:SendData("\ttArgs[" .. iIndex .. "] = " .. sArgument)
end
-- Return 1 to stop the server from sending the text
return 1
end
-- Register the command 'hello' to call the function doHello
regCommand("HeLlo", doHello, 10)
-- Now type '!hello and some arguments' into the main chat
This demo version is complete with registering, profiles and other api's for your use.
Events.lua
----------------------------
regPtokaxEvent(sEvent, fFunction)
doPtokaxEvent(sEvent, vArg1, vArg2)
regProtocolEvent(sEvent, fFunction)
doProtocolEvent(sEvent, vArg1, vArg2)
regCommand(sCommand, fFunction, iLevel)
doCommand(sCommand, tUser, tArgs)
File Handling.lua
----------------------------
getFile(sFile)
Profiles.lua
----------------------------
addProfile(sProfileName, iLevel)
delProfile(sProfileName)
getProfileLevel(sProfileName)
getProfileName(iProfileLevel)
getRealProfileName(sProfileName)
getProfilesList()
isProfile(sProfileName)
Registering.lua
----------------------------
addRegisteredUser(sUsername, sPassword, sProfileName)
delRegisteredUser(sUsername)
getPassword(sUsername)
getUserProfile(sUsername)
getUserLevel(sUsername)
getRegisteredUserList(sProfileName)
sRegged(sUsername)
String Handling.lua
----------------------------
TranslateString(sString, tTranslations, bTranslateSystem, bTranslateHubInfo)
getHubInfoTranslation()
getSystemTranslationString()
ValidateString(sString, tBadStrings)
getSettingBlock(sSettingName, sString)
System.lua
----------------------------
ForwardCommand(sCommand)
AddPrefix(sPrefix)
convertShareSize(iSize, iSkip)
ClearCslavePtokaxFunctions()
RestoreCslavePtokaxFunctions()
BuildArgumentTable(sData)
isOnline(sUsername)
Table Handling.lua
----------------------------
saveTable(tTable, sTableName, sFile)
writeTable(tTable, sTableName, hFile, sTab)
loadTable(sFile)
cSlave Internal API
----------------------------
RestartcSlave()
RestartScripts()
ExecuteAPI()
ExecuteSystemScripts()
ExecuteSettings()
ExecuteAddonScripts()
ExecuteAddons()
If u havnt downloaded it, you havnt seen the power!
cSlave 1.0 Full PreComplete Preview (http://www.snooze.no-ip.com/sk/dload.php?action=download&file_id=41)
is there smth wrong in Snooze's forum cause the cSlave section doesn't have anything in it ... :S
I am sure u put a lot of thinking in this Corayzon and I am eager to try it ;)
Good to see you ovecame the problem u had with ur pc and u are back online to lua us all ..... :D
It's been added to the download section @ Download Section (http://www.snooze.no-ip.com/sk/dload.php)
Direct link is: http://www.snooze.no-ip.com/sk/dload.php?action=category&cat_id=13
ok gracias .. ;) it is dnled as with no extension. .. adding ".rar" to it works ... off to try it ;)
it's also hosted here (http://www.plop.nl/ptokaxbots/Corayzon.php) on my site.
plop
so what u guys like and what u guys dont like?
ei. HelpSystem? Registering? so on
i want to know so i can make it how ppl want =]
noza