Please this 3 scripts tranlate in work with PtokaX
---------------DCversion
function VH_OnUserLogin(nick)
res, sMyInfoString = VH:GetMyINFO(nick)
if string.find(sMyInfoString,"<++") then
s,e,dcver = string.find(sMyInfoString,"V:(%x.%x+)")
if ((dcver>="0.403") and (dcver<="0.665")) and not IsUserOperator(nick) then
VH:SendDataToUser("<-HUBBOTS-> Aizliegti viltojumi un jebkura DC 0.403 versija un uz taas baazeetiee citi klienti!!!)",nick)
VH:CloseConnection(nick);
end
end
end
function IsUserOperator(nick)
res, class = VH:GetUserClass(nick)
if res and class > 4 then
return true
else
return false
end
end
-----------Minversion
function VH_OnUserLogin(nick)
res, sMyInfoString = VH:GetMyINFO(nick)
if string.find(sMyInfoString,"<++") then
s,e,dcver = string.find(sMyInfoString,"V:(%x.%x+)")
if ((dcver>="0.100") and (dcver<="0.399")) and not IsUserOperator(nick) then
VH:SendDataToUser("<-HUBBOTS-> Aizliegta jebkura DC++ versija mazaaka par 0.400!)",nick)
VH:CloseConnection(nick);
end
end
end
function IsUserOperator(nick)
res, class = VH:GetUserClass(nick)
if res and class > 4 then
return true
else
return false
end
end
--------oDCversion
function VH_OnUserLogin(nick)
res, sMyInfoString = VH:GetMyINFO(nick)
if string.find(sMyInfoString," s,e,dcver = string.find(sMyInfoString,"V:(%x.%x+)")
if ((dcver>="4.5") and (dcver<="5.313")) and not IsUserOperator(nick) then
VH:SendDataToUser("<-HUBBOTS-> Novecojusi oDC versija - nav hashings!)",nick)
VH:CloseConnection(nick);
end
end
end
function IsUserOperator(nick)
res, class = VH:GetUserClass(nick)
if res and class > 4 then
return true
else
return false
end
end
Sorry my bad language
-------------------------------------------
owner for Latvian hub Alfa
There is already a LUA5 minversion script aroung for ptokax I guess so no need to convert.
Also I see that verli API is bit more complicated than Px... :)
Yup verli api is very complicated :D
---------------DCversion
function NewUserConnected(curUser)
if curUser.bOperator == nil and curUser.bHasTag and curUser.sClient == "DC++" and tonumber(curUser.sClientVersion) ~= nil then
if((tonumber(curUser.sClientVersion) >= 0.403) and (tonumber(curUser.sClientVersion) <= 0.665)) then
curUser:SendData("<-HUBBOTS-> Aizliegti viltojumi un jebkura DC 0.403 versija un uz taas baazeetiee citi klienti!!!)")
curUser:Disconnect()
end
end
end
-----------Minversion
function NewUserConnected(curUser)
if curUser.bOperator == nil and curUser.bHasTag and curUser.sClient == "DC++" and tonumber(curUser.sClientVersion) ~= nil then
if((tonumber(curUser.sClientVersion) >= 0.100) and (tonumber(curUser.sClientVersion)<= 0.399)) then
curUser:SendData("<-HUBBOTS-> Aizliegta jebkura DC++ versija mazaaka par 0.400!)")
curUser:Disconnect()
end
end
end
--------oDCversion
function NewUserConnected(curUser)
if curUser.bOperator == nil and curUser.bHasTag and curUser.sClient == "oDC" and tonumber(curUser.sClientVersion) ~= nil then
if((tonumber(curUser.sClientVersion) >= 4.5) and (tonumber(curUser.sClientVersion) <= 5.313)) then
curUser:SendData("<-HUBBOTS-> Novecojusi oDC versija - nav hashings!)")
curUser:Disconnect()
end
end
end
thanks, works ok :)))
Please converter so this
-----------------------------------------------------------
-- VIPbots
-----------------------------------------------------------
kb = 1024
mb = kb*kb
gb = kb*kb*kb
tb = kb*kb*kb*kb
-----------------------------------------------------------
-- All Share values are in GB
-- VIP User = 2 (original set from ptokax)
-----------------------------------------------------------
BotName = "-VIPBOTS-"
VIP = {
Level = 2,
MinShare = 3,
MaxShare = 5000,
}
-------------------------------------------------------------------------------------------------------------
function Main()
-- frmHub:RegBot(BotName)
end
-------------------------------------------------------------------------------------------------------------
function DataArrival(curUser,data)
if (strsub(data,1,7) == "$MyINFO") then
CheckShare(curUser,data)
end
end
-------------------------------------------------------------------------------------------------------------
function CheckShare(curUser,data)
s,e, vShare = strfind(data,"$+(%d+)$+|+")
if vShare ~= nil then
-- Vip User Check Share -------------------------------------------------------------------------------------
if curUser.iProfile == VIP.Level then
if (tonumber(vShare) < VIP.MinShare * gb) then
curUser:SendPM(BotName," VIP shaares minimums - "..VIP.MinShare.." Gb")
curUser:SendPM(BotName," Atvienoju...")
curUser:Disconnect()
end
end
end
end
Sorry my bad language
-------------------------------------------
owner for Latvian hub Alfa
This is ok:
-- Converted the script into LUA 5 by 6Marilyn6Manson6
-----------------------------------------------------------
-- VIPbots
-----------------------------------------------------------
kb = 1024
mb = kb*kb
gb = kb*kb*kb
tb = kb*kb*kb*kb
-----------------------------------------------------------
-- All Share values are in GB
-- VIP User = 2 (original set from ptokax)
-----------------------------------------------------------
BotName = "-VIPBOTS-"
VIP = {
Level = 2,
MinShare = 3,
MaxShare = 5000,
}
-------------------------------------------------------------------------------------------------------------
function Main()
-- frmHub:RegBot(BotName)
end
-------------------------------------------------------------------------------------------------------------
function DataArrival(curUser,data)
if (string.sub(data,1,7) == "$MyINFO") then
CheckShare(curUser,data)
end
end
-------------------------------------------------------------------------------------------------------------
function CheckShare(curUser,data)
s,e, vShare = string.find(data,"$+(%d+)$+|+")
if vShare ~= nil then
if curUser.iProfile == VIP.Level then
if (tonumber(vShare) < VIP.MinShare * gb) then
curUser:SendPM(BotName," VIP shaares math.minimums - "..VIP.MinShare.." Gb")
curUser:SendPM(BotName," Atvienoju...")
curUser:Disconnect()
end
end
end
end
bye bye
sorry, not work
Post you're error please
I have made it but not tested:
-----------------------------------------------------------
-- Vip Share Bot v.1.0
-- By: 6Marilyn6Manson6 At 8:05 PM 03/02/2005
-----------------------------------------------------------
kb = 1024
mb = kb*kb
gb = kb*kb*kb
tb = kb*kb*kb*kb
-----------------------------------------------------------
-- All Share values are in GB
-- Need to Set correct Level/Profile
-- on those levels that are nil.
-----------------------------------------------------------
-- Start of Editable Data --
BotName = "VIPShare"
-- VIP User --
VIPLvl = 2
VIP = {
MinShare = 0,
MaxShare = 1000000,
MinSlots = 0,
MaxSlots = 1000,
}
-------------------------------------------------------------
function Main()
frmHub:RegBot(BotName)
end
-------------------------------------------------------------
function DataArrival(curUser,data)
if (string.sub(data,1,7) == "$MyINFO") then
local _,_, Slots = string.find(data,".*S:(%d+)")
elseif curUser.iProfile == VIPLvl then
CheckSlots(curUser,VIP.MinSlots,VIP.MaxSlots,Slots)
end
end
function CheckSlots(curUser,mnSlots,mxSlots,Slots)
if Slots==nil then
curUser:SendData(BotName,"Don't hide your tag...")
curUser:Disconnect()
elseif (tonumber(Slots) < mnSlots) then
curUser:SendData(BotName,"You have only "..Slots.." slot(s) open... You should have at least "..mnSlots.." slot(s) open. ")
curUser:Disconnect()
elseif (tonumber(Slots) > mxSlots) then
curUser:SendData(BotName,"You should have at most "..Slots.." slots open... Maximum of slots is "..mxSlots..". ")
curUser:Disconnect()
end
end
function CheckShare(curUser,data)
s,e, vShare = string.find(data,"$+(%d+)$+|+")
if vShare ~= nil then
elseif curUser.iProfile == VIPLvl then
if (tonumber(vShare) < VIP.MinShare * gb) then
curUser:SendData(BotName,"As a VIP you should have at least "..VIP.MinShare.." GB in your share.")
curUser:Disconnect()
end
end
end
bye bye
no syntax error, 0 emotion
Try now.
-----------------------------------------------------------
-- Vip Share Bot v.1.0
-- By: 6Marilyn6Manson6 At 8:05 PM 03/02/2005
-- fixed by bastya_elvtars
-----------------------------------------------------------
kb = 1024
mb = kb*kb
gb = kb*kb*kb
tb = kb*kb*kb*kb
-----------------------------------------------------------
-- All Share values are in GB
-- Need to Set correct Level/Profile
-- on those levels that are nil.
-----------------------------------------------------------
-- Start of Editable Data --
BotName = "VIPShare"
-- VIP User --
VIPLvl = 2
VIP = {
MinShare = 0,
MaxShare = 1000000,
MinSlots = 0,
MaxSlots = 1000,
}
-------------------------------------------------------------
function Main()
frmHub:RegBot(BotName)
end
-------------------------------------------------------------
function MyINFOArrival(curUser,data)
local _,_, Slots = string.find(data,".*S:(%d+)")
if curUser.iProfile == VIPLvl then
CheckSlots(curUser,VIP.MinSlots,VIP.MaxSlots,Slots)
end
end
function CheckSlots(curUser,mnSlots,mxSlots,Slots)
if Slots==nil then
curUser:SendData(BotName,"Don't hide your tag...")
curUser:Disconnect()
elseif (tonumber(Slots) < mnSlots) then
curUser:SendData(BotName,"You have only "..Slots.." slot(s) open... You should have at least "..mnSlots.." slot(s) open. ")
curUser:Disconnect()
elseif (tonumber(Slots) > mxSlots) then
curUser:SendData(BotName,"You should have at most "..Slots.." slots open... Maximum of slots is "..mxSlots..". ")
curUser:Disconnect()
end
end
function CheckShare(curUser,data)
s,e, vShare = string.find(data,"$+(%d+)$+|+")
if vShare then
if curUser.iProfile == VIPLvl and (tonumber(vShare) < VIP.MinShare * gb) then
curUser:SendData(BotName,"As a VIP you should have at least "..VIP.MinShare.." GB in your share.")
curUser:Disconnect()
end
else
curUser:SendData(BotName,"Your client is stupid.")
end
end
not work. My test VIP share is 94 Gb.
These
-- VIP User --
VIPLvl = 2
VIP = {
MinShare = 150,
MaxShare = 50,
MinSlots = 0,
MaxSlots = 1000,
no errors , 0 emotions
Profile manager off
QuoteOriginally posted by Zigurds
not work. My test VIP share is 94 Gb.
These
-- VIP User --
VIPLvl = 2
VIP = {
MinShare = 150,
MaxShare = 50,
MinSlots = 0,
MaxSlots = 1000,
no errors , 0 emotions
Profile manager off
test this min version script =>
Clicker Here (http://board.univ-angers.fr/thread.php?threadid=3725&boardid=29&styleid=1&sid=8503f98720aa93db15c56b996af119b7#5)
And try this slot checker =>
Click Here (http://board.univ-angers.fr/thread.php?threadid=3764&boardid=26&styleid=1&sid=8503f98720aa93db15c56b996af119b7)
And also try this share checker =>
Click Here (http://board.univ-angers.fr/thread.php?threadid=3770&boardid=26&styleid=1&sid=8503f98720aa93db15c56b996af119b7)
(if you also want max share, then I can add it.)
Above script edited.
bastya_elvtars, the Vip share script use code that isn't needed for detecting share+slots
no, no, my interest only VIP share check min and max
and little script slots in connections:
-- Slots vs Connection Speed by [aXs] Wellx 11/06-03
-- Thx goes to Sedulus & aMutex for idea's and help
-- This script checks for slots vs speed and Disconnect if not Master/Operator/VIP
-- Optimized a bit made some no-used code at first...p
Connection={}
Connection["28.8Kbps"] = 0
Connection["33.6Kbps"] = 0
Connection["56Kbps"] = 0
Connection["ISDN"] = 0
Connection["Satellite"] = 0
Connection["Cable"] = 20
Connection["DSL"] = 24
Connection["LAN(T1)"] = 27
Connection["LAN(T3)"] = 30
function DataArrival(curUser, data)
if strsub( data, 1, 8 ) == "$MyINFO " and (curUser.iProfile < 0 or curUser.iProfile > 2) then
SlotsCheck(curUser, strsub(data, 1, strlen(data) -1))
end
end
function SlotsCheck(curUser, myinfo)
local s,e,Slots,speed = strfind(myinfo, "S:([^,>]+).*>$ $([^$]*)")
local Slots = tonumber(Slots)
if speed then
local speed = strsub(speed,1,strlen(speed)-1)
if Connection[speed] and Slots > Connection[speed] then
curUser:SendPM("<-SLOTBOTS->", "Par daudz atveertu slotu shim piesleegumam! Maksimums ir ("..Connection[speed]..") Tev atveerti ("..Slots..") sloti")
-- SendToOps("<-SLOTBOTS->","*** Juuzeris <"..curUser.sName.."> IP <" ..curUser.sIP.."> Nepareizs slotu skaits! Atvienots:)")
curUser:Disconnect()
end
end
end
Here then one my verlihub script
---------------------------------------------------------------------------------------------------------------------
-- CENSORBOTS
---------------------------------------------------------------------------------------------------------------------
trigs = {["?"]=1,["?"]=2,["?"]=3,["?"]=4,["?"]=5,["?"]=6,["?"]=7,["?"]=8,["?"]=9,["?"]=10,["?"]=11,["?"]=12,["?"]=13,["?"]=14,["?"]=15,["?"]=16,["?"]=17,["?"]=18,["?"]=19,["?"]=20,["?"]=21,["?"]=22,["?"]=23,["?"]=24,["?"]=25,["?"]=26,["?"]=27,["?"]=28,["?"]=29,["?"]=30}
max_class = 3
botname = "-CENSORBOTS-"
iemesls = "6. rule - Huba pamatvaloda ir latvieshu, bet lietojama tikai translitaa. Krieviski rakstiit atlauts tikai ar latiinju alfabeta burtiem!"
--------
-- Aiz shiis liinijas neko nelabojam :)
--------
function IsUserAdmin(nick)
res, class = VH:GetUserClass(nick)
if res and class >= max_class then
return true
else
return false
end
end
function cenzura(nick,data)
if not IsUserAdmin(nick) then
for key,a in trigs do
if(string.find(data, key)) then
VH:SendDataToUser("<"..botname.."> "..iemesls,nick)
VH:CloseConnection(nick);
return 0
end
end
end
return 1
end
function VH_OnParsedMsgChat(nick, data)
return cenzura(nick,data)
end
function VH_OnParsedMsgMyINFO(nick, data)
return cenzura(nick,data)
end