Author Topic: Script Interface  (Read 2008 times)

0 Members and 1 Guest are viewing this topic.

Offline 6Marilyn6Manson6

  • Scripter
  • King
  • ******
  • Posts: 869
  • Karma: +47/-35
    • http://www.marilynmanson986.altervista.org
Script Interface
« on: 05 May, 2005, 20:27:55 »
hello, I have this script interface for ptokax 330...

frmHub
------
RegBot(BotName)            - Chars $|<>:?*"/\ and space not allowed, max length 64 chars. Here hub not create myinfo, you need for compatibility with some clients (DC2) to send bot myinfo by script !
RegBot(BotName, IsOP, Description, Email)   - Chars $|<>:?*"/\ and space not allowed in nick, $| not allowed in Description and Email, max length 64 chars per string. IsOP is number, 1 = have key, 0 = not have key. With this is created $MyINFO for bot !!! If you want $MyINFO without key/description/email use for example RegBot("botname", 0, "", "")
UnregBot(BotName)
GetUsersCount()            - Return hub user count, same value as Users: in gui.
GetHubName()
SetHubName(NewName)
GetHubDescr()
SetHubDescr(NewDescription)
GetHubAddress()
GetHubIp()
GetHubPort()
GetHubUdpPort()
GetHubTopic()
SetHubTopic(NewTopic)
GetRegServer()
SetRegServer(NewAddress)
SetAutoRegister(0/1)         - 0 disable 1 enable
GetMaxUsers()
SetMaxUsers(MaxUsers)         - number from 0 to 5000
GetMaxLogins()
SetMaxLogins(MaxLogins)         - number from 0 to 500
GetMinShare()            - return minshare in MB
SetMinShare(MinShare, ShareUnit)   - ShareUnits 0 = B, 1 = kB, 2 = MB, 3 = GB, 4 = TB
GetMinSlots()
SetMinSlots(MinSlots)
GetMaxSlots()
SetMaxSlots(MaxSlots)
GetHubRatio()
GetSlotRatio()
SetHubSlotRatio(Hubs, Slots)
GetMaxHubs()
SetMaxHubs(MaxHubs)
GetCurrentShareAmount()
GetOnlineUsers(ProfileNumber)      - Without number return table with all logged user objects, with number only users with given profile.
GetOpChatName()
SetOpChatName(NewOpChatName)      - Max OpChat length is 64 chars !!!
GetOpChatDescription()
GetOpChatEmail()
SetOpChatData(NewOpChatName, NewDescription, NewEmail)   - Max length of string is 64 chars !!! In nick is not allowed $|<>:?*"/\ and space. In Description and Email is not allowed $ and |.
GetHubBotName()
SetHubBotName(NewHubBotName)      - Max Bot length is 64 chars !!!
GetHubBotDescription()
GetHubBotEmail()
SetHubBotData(NewHubBotName, NewDescription, NewEmail)   - Max length of string is 64 chars !!! In nick is not allowed $|<>:?*"/\ and space. In Description and Email is not allowed $ and |.
Restart()
GetOpChat()
SetOpChat(0/1)            - 0 disable 1 enable
GetHubBot()
SetHubBot(0/1)            - 0 disable 1 enable
GetPtokaXLocation()
GetRedirectAddress()
SetRedirectAddress(NewAddress)
GetShareRedirAddr()
SetShareRedirAddr(NewAddress)
GetShareRedirect()
SetShareRedirect(0/1)         - 0 disable 1 enable
GetSlotsRedirAddr()
SetSlotsRedirAddr(NewAddress)
GetSlotsRedirect()
SetSlotsRedirect(0/1)         - 0 disable 1 enable
GetRatioRedirAddr()
SetRatioRedirAddr(NewAddress)
GetRatioRedirect()
SetRatioRedirect(0/1)         - 0 disable 1 enable
GetMaxHubsRedirAddr()
SetMaxHubsRedirAddr(NewAddress)
GetMaxHubsRedirect()
SetMaxHubsRedirect(0/1)         - 0 disable 1 enable
GetNoTagRedirAddr()
SetNoTagRedirAddr(NewAddress)
GetNickRuleRedirAddr()
SetNickRuleRedirAddr(NewAddress)
GetNickRuleRedirect()
SetNickRuleRedirect(0/1)      - 0 disable 1 enable
GetTempBanRedirect()
SetTempBanRedirect(0/1)         - 0 disable 1 enable
GetTempBanRedirAddr()
SetTempBanRedirAddr(NewAddress)
GetBanRedirect()
SetBanRedirect(0/1)         - 0 disable 1 enable
GetBanRedirAddr()
SetBanRedirAddr(NewAddress)
GetRedirectAll()
SetRedirectAll(0/1)         - 0 disable 1 enable
GetRedirectFull()
SetRedirectFull(0/1)         - 0 disable 1 enable
GetNoTagOption()         - 1 accept 2 reject 3 redirect
SetNoTagOption(1/2/3)         - 1 accept 2 reject 3 redirect
GetRegOnlyRedirect()
SetRegOnlyRedirect(0/1)         - 0 disable 1 enable
GetRegOnlyRedirAddr()
SetRegOnlyRedirAddr(NewAddress)
GetHubBotIsAlias()
SetHubBotIsAlias(0/1)         - 0 disable 1 enable
GetHubSecAliasName()
GetUserPassword(Nick)         - Return user password, if is registered.
GetUpTime()            - Return hub uprime in seconds.
isNickRegged(Nick)         - Return 1 if user is registered, else nil.
GetActualUsersPeak()
GetMaxUsersPeak()
GetOnlineRegUsers()         - Return table with all logged and registered (profile > -1) user objects.
GetPrefixes()            - Return table with hub commands prefixes.
GetRegisteredUsers()         - Return table with all registered users as RegisteredUser objects.
GetTempBanList()         - Return table with all registered users as TempBan objects.
GetPermBanList()         - Return table with all registered users as PermBan objects.
GetOnlineOperators()         - Return table with all logged user objects with operator status.
GetOnlineNonOperators()         - Return table with all logged user objects without operator status.
GetOperators()            - Return table with all registered users with operator status as RegisteredUser objects.
GetNonOperators()         - Return table with all registered users without operator statusas RegisteredUser objects.
RestartScripts()         - Restart all scripts.
SetPrefixes(newprefixes)      - Set new hub commands prefixes, max 5 prefixes allowed !

Global
------
SendToAll(Nick, Data)         - Data without ending | !
SendToAll(Data)            - Data without ending | !
SendPmToAll(FromNick, Data)      - Data without ending | !
SendToNick(Nick, Data)         - Data without ending | !
SendPmToNick(ToNick, FromNick, Data)   - Data without ending | !
SendToOps(FromNick, Data)      - Data without ending | !
SendPmToOps(FromNick, Data)      - Data without ending | !
DisconnectByName(Nick)
GetItemByName(Nick)
GetBannedItemIp(Nick)
GetBannedItemName(IP)
Unban(Nick/IP)
TempUnban(IP)
ClearTempBan()
ClearPermBan()
AddRegUser(Nick, Pass, ProfileNumber)   - Default profile numbers 0 Master 1 Operator 2 VIP 3 Reg
DelRegUser(Nick)         - Return 1 success or -1 failed
Ban(IP)
NickBan(Nick)
TempBan(IP)
TimeBan(IP, TimeInMinutes)
GetTempBannedItemIp(Nick)
GetTempBannedItemName(IP)
GetTempBannedItemTime(IP)      - Return remaining temp ban time in minutes.

Profiles
-------
AddProfile(ProfileName, ProfileNumber)   - Return 1 success or -1 failed
RemoveProfile(ProfileName)      - Return 1 success 0 failed (profile don't exist or default profile (0-3)) -1 failed (profile in use)
GetProfiles()            - Return table with profilenames ... table starting with 1 but real profile number is 0 !
GetProfileIdx(ProfileName)      - Return ProfileNumber or -1 failed
GetProfileName(ProfileNumber)      - Return ProfileName or nil for failed
GetUsersByProfile(ProfileName)      - Return table with user nicks of given profile name or nil for failed
GetUserProfile(Nick)         - Return user profile number if is registered, else nil.

Timer
-----
SetTimer(TimeInterval)
StartTimer()
StopTimer()
GetTimer()            - return timer state, 1 for enabled and nil for disabled.
GetTimerInterval()         - return timer interval.

User:
-----
SendData(FromNick, Data)      - Data without ending | !
SendData(Data)            - Data without ending | !
SendPM(FromNick, Data)         - Data without ending | !
Disconnect()
Kick(KickerNick, Reason)      - Reason without ending | !
Kick(Reason)            - Reason without ending | !
Ban()
NickBan()
TempBan()
TimeBan(TimeInMinutes)
Redirect(Address, Reason)      - redirect user to address, with reason. Reason is optional.

User.
-----
sName
sClient
sClientVersion
sMode
sIP
sMyInfoString
bUserCommand
bOperator
bRegistered
bHasTag
bActive
iShareSize
iProfile
iVersion            - return version from $Version nmdc command as string !
iHubs
iSlots
iBlimit
iLlimit
sTag
sDescription
sConnection
sEmail
iNormalHubs
iRegHubs
iOpHubs
bConnected            - User is added in hub (visible for other users) and added is after NewUser(Op)Connected.

RegisteredUser.
-----
sNick
sPassword
iProfile

TempBan.
-----
sIP
sNick
iTime

PermBan.
-----
sIP
sNick

Functions
---------
Main()
OnExit()
OnTimer()
NewUserConnected(User)
UserDisconnected(User)
OpConnected(User)
OpDisconnected(User)
OnError(ErrorMsg)
SupportsArrival(User, Data)         - Incoming supports from user.
ChatArrival(User, Data)            - Incoming chat message from user. If script return 1 hub don't process data.
KeyArrival(User, Data)            - Incoming key from user.
ValidateNickArrival(User, Data)         - Incoming validate nick from user.
PasswordArrival(User, Data)         - Incoming password from user.
VersionArrival(User, Data)         - Incoming version from user.
GetNickListArrival(User, Data)         - Incoming get nick list request from user.
MyINFOArrival(User, Data)         - Incoming user myinfo.
GetINFOArrival(User, Data)         - Incoming get info request from user.
SearchArrival(User, Data)         - Incoming search request from user. If script return 1 hub don't process data.
ToArrival(User, Data)            - Incoming private message from user. If script return 1 hub don't process data.
ConnectToMeArrival(User, Data)         - Incoming active connection request from user. If script return 1 hub don't process data.
MultiConnectToMeArrival(User, Data)      - Incoming multi connection request from user. If script return 1 hub don't process data.
RevConnectToMeArrival(User, Data)      - Incoming pasive connection request from user. If script return 1 hub don't process data.
SRArrival(User, Data)            - Incoming search reply from user. If script return 1 hub don't process data.
KickArrival(User, Data)            - Incoming kick command from user. If script return 1 hub don't process data.
OpForceMoveArrival(User, Data)         - Incoming redirect command from user. If script return 1 hub don't process data.
UserIPArrival(User, Data)         - Incoming user ip request from user. If script return 1 hub don't process data.
UnknownArrival(User, Data)         - Incoming unknown command from user. If script return 1 hub don't process data (don't disconnect user).
BotINFOArrival(User, Data)         - Incoming hublist pinger request from user. If script return 1 hub don't process data.


can I have script interface for ptokax 330 15.25... for LUA 4? Thanks

PtokaX forum

Script Interface
« on: 05 May, 2005, 20:27:55 »

Offline plop

  • Forum God
  • ****
  • Posts: 2 464
  • Karma: +37/-0
(No subject)
« Reply #1 on: 08 May, 2005, 18:21:07 »
scripting.txt which you can find in the docs folder.

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

Offline 6Marilyn6Manson6

  • Scripter
  • King
  • ******
  • Posts: 869
  • Karma: +47/-35
    • http://www.marilynmanson986.altervista.org
(No subject)
« Reply #2 on: 08 May, 2005, 18:26:00 »
Quote
Originally posted by plop
scripting.txt which you can find in the docs folder.

plop

I don't find it plop :C ... you have it? is it very important thanks

PtokaX forum

(No subject)
« Reply #2 on: 08 May, 2005, 18:26:00 »