Adăugam la inceput
Cod: Selectaţi tot
SECURIATE_QUESTINDEX = 0
NegotFereastraNume = 0
SECURIATE_CONT = 1
INPUT_IGNORE = 0Căutăm
Cod: Selectaţi tot
def __del__(self):
ui.ScriptWindow.__del__(self)Cod: Selectaţi tot
def ParolaInventarWnd(self):
self.ParolaInventar = ui.BoardWithTitleBar()
self.ParolaInventar.SetSize(180, 100)
self.ParolaInventar.SetCenterPosition()
self.ParolaInventar.AddFlag('movable')
self.ParolaInventar.AddFlag('float')
self.ParolaInventar.SetTitleName('Inventar')
self.ParolaInventar.SetCloseEvent(self.InchidereParolaInventar)
self.ParolaInventar.Show()
self.TextParola = ui.TextLine()
self.TextParola.SetParent(self.ParolaInventar)
self.TextParola.SetDefaultFontName()
self.TextParola.SetPosition(15, 35)
self.TextParola.SetFeather()
self.TextParola.SetText("Parola inventar:")
self.TextParola.SetOutline()
self.TextParola.Show()
self.SlotParola = ui.SlotBar()
self.SlotParola.SetParent(self.ParolaInventar)
self.SlotParola.SetSize(60, 15)
self.SlotParola.SetPosition(30, 35)
self.SlotParola.SetWindowHorizontalAlignCenter()
self.SlotParola.Show()
self.CampParola = ui.EditLine()
self.CampParola.SetParent(self.SlotParola)
self.CampParola.SetSize(60, 15)
self.CampParola.SetPosition(4, 1)
self.CampParola.SetMax(4)
self.CampParola.SetNumberMode()
self.CampParola.SetFocus()
self.CampParola.Show()
self.ButonParolaOK = ui.Button()
self.ButonParolaOK.SetParent(self.ParolaInventar)
self.ButonParolaOK.SetEvent(self.VerificareParola)
self.ButonParolaOK.SetPosition(46, 67)
self.ButonParolaOK.SetUpVisual("d:/ymir work/ui/public/large_button_01.sub")
self.ButonParolaOK.SetOverVisual("d:/ymir work/ui/public/large_button_02.sub")
self.ButonParolaOK.SetDownVisual("d:/ymir work/ui/public/large_button_03.sub")
self.ButonParolaOK.SetText("Deblocare")
self.ButonParolaOK.Show()
self.CampParola.SetReturnEvent(ui.__mem_func__(self.VerificareParola))
def VerificareParola(self):
self.ParolaInventar.Hide()
activare_skill2 = constInfo.SECURIATE_QUESTINDEX
constInfo.NegotFereastraNume = self.CampParola.GetText()
event.QuestButtonClick(activare_skill2)
def InchidereParolaInventar(self):
self.ParolaInventar.Hide()
def Show(self):
if constInfo.SECURIATE_CONT == 0:
self.__LoadWindow()
ui.ScriptWindow.Show(self)
else:
self.ParolaInventarWnd()Cod: Selectaţi tot
def ParolaInventarWnd(self):
self.ParolaInventar = ui.BoardWithTitleBar()
self.ParolaInventar.SetSize(180, 100)
self.ParolaInventar.SetCenterPosition()
self.ParolaInventar.AddFlag('movable')
self.ParolaInventar.AddFlag('float')
self.ParolaInventar.SetTitleName('Inventar')
self.ParolaInventar.SetCloseEvent(self.InchidereParolaInventar)
self.ParolaInventar.Show()
self.TextParola = ui.TextLine()
self.TextParola.SetParent(self.ParolaInventar)
self.TextParola.SetDefaultFontName()
self.TextParola.SetPosition(15, 35)
self.TextParola.SetFeather()
self.TextParola.SetText("Parola inventar:")
self.TextParola.SetOutline()
self.TextParola.Show()
self.SlotParola = ui.SlotBar()
self.SlotParola.SetParent(self.ParolaInventar)
self.SlotParola.SetSize(60, 15)
self.SlotParola.SetPosition(30, 35)
self.SlotParola.SetWindowHorizontalAlignCenter()
self.SlotParola.Show()
self.CampParola = ui.EditLine()
self.CampParola.SetParent(self.SlotParola)
self.CampParola.SetSize(60, 15)
self.CampParola.SetPosition(4, 1)
self.CampParola.SetMax(4)
self.CampParola.SetNumberMode()
self.CampParola.SetFocus()
self.CampParola.Show()
self.ButonParolaOK = ui.Button()
self.ButonParolaOK.SetParent(self.ParolaInventar)
self.ButonParolaOK.SetEvent(self.VerificareParola)
self.ButonParolaOK.SetPosition(46, 67)
self.ButonParolaOK.SetUpVisual("d:/ymir work/ui/public/large_button_01.sub")
self.ButonParolaOK.SetOverVisual("d:/ymir work/ui/public/large_button_02.sub")
self.ButonParolaOK.SetDownVisual("d:/ymir work/ui/public/large_button_03.sub")
self.ButonParolaOK.SetText("Deblocare")
self.ButonParolaOK.Show()
self.CampParola.SetReturnEvent(ui.__mem_func__(self.VerificareParola))
def VerificareParola(self):
self.ParolaInventar.Hide()
activare_skill2 = constInfo.SECURIATE_QUESTINDEX
constInfo.NegotFereastraNume = self.CampParola.GetText()
event.QuestButtonClick(activare_skill2)
def InchidereParolaInventar(self):
self.ParolaInventar.Hide()
def Show(self):
if constInfo.SECURIATE_CONT == 0:
self.__LoadWindow()
ui.ScriptWindow.Show(self)
if self.isOpenedCostumeWindowWhenClosingInventory and self.wndCostume:
self.wndCostume.Show()
if self.wndBelt:
self.wndBelt.Show(self.isOpenedBeltWindowWhenClosingInventory)
else:
self.ParolaInventarWnd()Cautam "PlayMusic" : self.__PlayMusic,
adaugam mai jos !
Cod: Selectaţi tot
#DASH
"getinputbegin" : self.__Input_Get_Dash_1,
"getinputend" : self.__Input_Get_Dash_2,
"getinput" : self.__Input_Get_Dash_3,
"securitate_index" : self.SecuriateQuestIndex,
"sistem_negot_verificare_nume" : self.__Sistem_negot_verificare_nume,
"securiate_cont" : self.SecuriateCont,
"activareinv" : self.ActivareInv,
#DASH Cod: Selectaţi tot
#DASH
def __Input_Get_Dash_1(self):
constInfo.INPUT_IGNORE = 1
def __Input_Get_Dash_2(self):
constInfo.INPUT_IGNORE = 0
def __Input_Get_Dash_3(self):
net.SendQuestInputStringPacket("1")
def SecuriateQuestIndex(self, value):
#chat.AppendChat(chat.CHAT_TYPE_INFO, "index %d" % int(value))
constInfo.SECURIATE_QUESTINDEX = int(value)
def __Sistem_negot_verificare_nume(self):
net.SendQuestInputStringPacket(str(constInfo.NegotFereastraNume))
def SecuriateCont(self):
constInfo.SECURIATE_CONT = 0
def ActivareInv(self):
constInfo.SECURIATE_CONT = 1
#DASHAdaugam un fiser nume securitate in quest !
adaugam in quest_functions
Cod: Selectaţi tot
citire_parola
file_exists
resetare_parola
setare_parolaCod: Selectaţi tot
DirectorSecuritate = get_locale_base_path().."/quest/securitate/"
function citire_parola()
local FisierPassword = DirectorSecuritate..pc.get_name().."_securitate.txt"
local parola
if io.open(FisierPassword, "r") != nil then
io.input(FisierPassword)
parola = tonumber(io.read())
io.input():close()
else
parola = 0
end
return parola
end
function file_exists()
local name = DirectorSecuritate..pc.get_name().."_securitate.txt"
local f=io.open(name,"r")
if f!=nil then
io.close(f)
return true
else
return false
end
end
function setare_parola(nr_buton)
local name = DirectorSecuritate..pc.get_name().."_securitate.txt"
io.output(name)
io.write(tostring(nr_buton))
io.flush()
io.close()
end
function resetare_parola()
local name = DirectorSecuritate..pc.get_name().."_securitate.txt"
os.remove(name)
endCod: Selectaţi tot
quest securitate_inv begin
state start begin
function GetPassword()
cmdchat("getinputbegin")
password = input(cmdchat("sistem_negot_verificare_nume"))
cmdchat("getinputend")
--chat("-cenzurat- mea "..password)
return password
end
when login begin
cmdchat("securitate_index "..q.getcurrentquestindex()) -- -cenzurat- Poate Merge
--chat("Ai afisat Sistemul de Putere "..q.getcurrentquestindex())
if file_exists() != true then
cmdchat("securiate_cont")
else
cmdchat("activareinv")
end
end
when button or info begin
--chat("Ai afis123123")
local password = securitate_inv.GetPassword()
--chat("-cenzurat- mea "..password)
--chat("-cenzurat- mea2 "..citire_parola())
if tonumber(password) == tonumber(citire_parola()) then
cmdchat("securiate_cont")
--chat("Ai afis123123")
end
end
when 20152.chat."Setare parola" begin
if file_exists() != true then
say("stati parola")
local item_vnum = input()
setare_parola(item_vnum)
cmdchat("activareinv")
else
say("In cazul in care va uitati parola de la inventar")
say("luati legatura cu un [Owner]Alyn !")
end
end
when 20152.chat."Resetare parola" begin
if file_exists() != true then
say("Nu puteti reseta parola")
else
say("Introduceti parola veche")
local item_vnum = input()
if tonumber(item_vnum) == tonumber(citire_parola()) then
say("introduceti parola noua")
local item_vnum1 = input()
resetare_parola()
setare_parola(item_vnum1)
else
say("Parola este gresita")
end
end
end
end
end


de