myDC.ru

Здравствуйте, гость ( Вход | Регистрация )

 
История благодарностей участнику philoum. Спасибо сказали: 2
Дата поста: В теме: За сообщение: Спасибо сказали:
30.12.2010, 9:15 Вопросы по RusHub
Технические вопросы
HI, en error on rushub and scratched :

(error)[Thu Dec 30 06:46:11 2010|968] (0) cConnSelect: Fatal error:
error in operator *()
Item = 00AA69C8
Hash = 360
End = 2048
(error)[Thu Dec 30 06:46:11 2010|968] (0) cConnSelect:

thanks for help
Greetings and good "réveillon" 31 ! big_smile.gif)
Setuper
14.12.2010, 7:53 'БАННЕР' для RusHub
Скрипт посылающий в главный чат оформленное в баннер сообщение
hi,
i dont have the rigth menu
i change some thing big_smile.gif
CODE
--###################################################################################
--## this script write Sekretchik aka ][shocked.gif][ livivng in Sosnogorsk Russia ##
--## dchub://sosnogorsk.no-ip.biz ## taduction fr by Philoum
--###################################################################################

sCmdToShowAll = "banner"
MaxSymbol = 5000
Menu = "--> Banner"

local OpNick = "þ††i£øû]v[™" -- Inscrivez le nom qui recevra le message d'erreur

tVIP = {
["NICKNAME_01"] = 1, -- remplir le nick citations, ce qui n'est pas le droit d'envoyer une bannière, mais leur comportement est digne (:
["NICKNAME_02"] = 1,
}

tProfile = {
[-1] = 0, -- L'utilisateur non enregistre
[0] = 1, -- Àdmin
[1] = 1, -- master
[2] = 1, -- moderator
[3] = 1, -- op
[4] = 0, -- vip
[5] = 0, -- reg
}
local sMenu = "$UserCommand 1 3 "..Menu.."$<%[mynick]> !"..sCmdToShowAll.." %[line:Texte de la bannière à envoyer en cc]&#124;"

function OnStartup()
sBot = Config.sHubBot
end

function OnUserEnter(UID)
if tProfile[UID.iProfile] == 1 or tVIP[UID.sNick] == 1 then
Core.SendToUser(UID, sMenu)
--Core.SendToUser(UID, "$UserCommand 1 1 "..Menu.."$<%[mynick]> !"..sCmdToShowAll.." %[line:Texte de la bannière à envoyer en cc]|")
end
end

function OnChat(UID, sData) -- Le message au chat
local _,_, sCmd = string.find(sData, "^%b<>%s+%p(%S+)") --Nous cherchons la commande
local _,_, advert = string.find(sData,"%b<>%s+%S+%s+(.+)")
if (sCmd==sCmdToShowAll) then
if not advert then
local reply1 = "\r\n\r\n"..
"\t"..string.rep("=", 67).."\r\n"..
"\tExcusez, les messages vides au chat, je n'expedie pas. Essayez encore une fois."..
"\t"..string.rep("=", 67).."\r\n"
Core.SendToUser(UID, reply1, sBot)
return true
elseif tProfile[UID.iProfile] == 1 or tVIP[UID.sNick] == 1 then
if sCmd and advert then
if string.len(advert) > MaxSymbol then
local reply2 = "\r\n\r\n"..
"\t"..string.rep("=", 67).."\r\n"..
"\tFait par vous nick comprend de ["..string.len(advert).."] Des symboles.\r\n"..
"\tLa quantite au maximum admissible de symboles dans le message - ["..MaxSymbol.."]\r\n"..
"\t"..string.rep("=", 67).."\r\n"
Core.SendToUser(UID, reply2, sBot)
return true
else
SendBanner(UID, advert)
return true
end
end
else
local reply3 = "\r\n\r\n"..
"\t"..string.rep("=", 75).."\r\n"..
"\tExcusez - "..UID.sNick.." - Mais vous ne pouvez pas utiliser la commande - !"..sCmdToShowAll.."\r\n"..
"\t"..string.rep("=", 75).."\r\n"
Core.SendToUser(UID.sNick, reply3, sBot)
return true
end
end
end

function SendBanner(UID, advert)
local border = "\r\n\r\n"
local border1 = border..string.rep("=",10).." Envoyé par "..UID.sNick.." "..string.rep("=",60).."\r\n\r\n"
local border2 = border..string.rep("=",60).." Envoyé par "..UID.sNick.." "..string.rep("=",10).."\r\n"
if UID and advert then
Core.SendToAll("<"..sBot..">" ..border1..Spacer(advert,string.len(border1))..advert..border2)
return true
end
end

Spacer = function(str,len)
if str then
local tab = ""
if string.len(str) < len then
local count = ((len - string.len(str)) / 2) / 10
if count > 0 then
for x = 1,count do
tab = tab.."\t"
end
end
end
str = nil
return tab
end
end

function OnError(sErrMsg)
local UID = Core.GetUser(OpNick)
if UID then
Core.SendToUser(UID.sNick, sErrMsg, UID.sNick, sBot)
end
end

thanks
greetings
X-Sky

RSS Сейчас: 26.6.2024, 3:47