Čħīċķėň
26-09-10, 10:49 AM
Lâu nì hok share cái gì mà toàn nói nhìu + spam + trém gió nên thấy trong người nhói nhói :(
Giờ tui share script pass rương này là để tạ tội với ae
Ai cần thì edit lại cho chuẩn rùi sài
Hàng cùi pắp ko xài thì đừng nói lời cay đắng tội em :(
Tuy nó ko có gì mới mẻ nhưng đc code lại với thuật toán rất ngắn :), sài nếu có bug thì post lên có gì mình sửa cho >:D<>:D<
\script\ruong\passruong.lua
-------------------------------------------------------------------------------
------------------ MAKE by chicken --------------------------------------------
-------------------- 29/8/2010 ------------------------------------------------
Include("\\script\\ruong\\list.lua"); --- duong dan toi script sai nho config lai cho chuan
idtaskruong = 133 ----- ID task ma ruong
idtasktempp = 157 ----- ID task luu ma ruong tam thoi
idtasktempp1 = 158 ---- ID Task so tang(floor)
idtasktempp2 = 159 ---- ID dieu kien lap mat khau va doi mat khau
tiendoipass = 50000 --- money change pass
function main()
SetTaskTemp(idtasktempp,0)
SetTaskTemp(idtasktempp1,0)
SetTaskTemp(idtasktempp2,0)
Say("<color=cyan>Ruong Chua Do:<color> Xin chao lu khach xin hoi nguoi muon gi ?",3,"Mo ruong chua do./morp","Doi mat khau[50v]./tgdmkp","Thoat./no");
end
function no()
SetTaskTemp(idtasktempp,0)
SetTaskTemp(idtasktempp1,0)
SetTaskTemp(idtasktempp2,0)
end;
function morp()
SetTaskTemp(idtasktempp2,0)
SetTaskTemp(idtasktempp1,GetTaskTemp(idtasktempp1) +1)
Say("<color=cyan>Ruong Chua Do:<color> Neu lu khach chua lap ma ruong, pass mac dinh se la : <color=green>000000<color>.\nBan hay nhap so thu : <color=blue>"..GetTaskTemp(idtasktempp1).."<color>",11,"0/luupass","1/luupass","2/luupass","3/luupass","4/luupass","5/luupass","6/luupass","7/luupass","8/luupass","9/luupass","Thoat./no");
end
function tgdmkp()
if GetCash() >= tiendoipass then
Pay(tiendoipass)
dmkp()
else
Talk(1,"no","Nguoi ko mang theo du tien ta can.")
end
end
function dmkp()
SetTaskTemp(idtasktempp2,1)
SetTaskTemp(idtasktempp1,GetTaskTemp(idtasktempp1) +1)
Say("<color=cyan>Ruong Chua Do:<color> Neu lu khach chua lap ma ruong, pass mac dinh se la : <color=green>000000<color>.\nMa ruong cu, ban hay nhap so thu : <color=blue>"..GetTaskTemp(idtasktempp1).."<color>",11,"0/luupass","1/luupass","2/luupass","3/luupass","4/luupass","5/luupass","6/luupass","7/luupass","8/luupass","9/luupass","Thoat./no");
end
function morp1()
local a,b,c,d,e,f = phantichpas(GetTask(idtaskruong))
local a1,b1,c1,d1,e1,f1 = phantichpas(GetTaskTemp(idtasktempp))
local tring1 = a..b..c..d..e..f -- chuoi ma ruong
local tring2 = a1..b1..c1..d1..e1..f1 -- chuoi ma ruong moi nhap(tuc thoi)
SetTaskTemp(idtasktempp,0)
SetTaskTemp(idtasktempp1,0)
SetTaskTemp(idtasktempp2,0)
if tring1 == tring2 then
OpenBox()
Msg2Player("Kiem tra ma ruong chinh xac.")
else
Talk(1,"no","Ban da nhap sai ma ruong.\nNeu quen thi ban co the lien he GM de lay lai.");
end
end
function dmkp1()
local a,b,c,d,e,f = phantichpas(GetTask(idtaskruong))
local a1,b1,c1,d1,e1,f1 = phantichpas(GetTaskTemp(idtasktempp))
local tring1 = a..b..c..d..e..f -- chuoi ma ruong
local tring2 = a1..b1..c1..d1..e1..f1 -- chuoi ma ruong moi nhap(tuc thoi)
SetTaskTemp(idtasktempp,0)
SetTaskTemp(idtasktempp1,0)
SetTaskTemp(idtasktempp2,0)
if tring1 == tring2 then
dmkp2()
else
Talk(1,"no","Ban da nhap sai ma ruong.\nNeu quen thi ban co the lien he GM de lay lai.");
end
end
function dmkp2()
SetTaskTemp(idtasktempp2,2)
SetTaskTemp(idtasktempp1,GetTaskTemp(idtasktempp1) +1)
Say("<color=cyan>Ruong Chua Do:<color> Ma ruong moi.\nBan hay nhap ma ruong thu : <color=blue>"..GetTaskTemp(idtasktempp1).."<color>",11,"0/luupass","1/luupass","2/luupass","3/luupass","4/luupass","5/luupass","6/luupass","7/luupass","8/luupass","9/luupass","Thoat./no");
end
function dmkp3()
local a1,b1,c1,d1,e1,f1 = phantichpas(GetTaskTemp(idtasktempp))
local tring2 = a1..b1..c1..d1..e1..f1 -- chuoi ma ruong moi nhap(tuc thoi)
SetTask(idtaskruong,tonumber(tring2))
hoanthanh()
end
function luupass(sel)
local tang = GetTaskTemp(idtasktempp1)
if GetTaskTemp(idtasktempp2) == 0 then
if tang == 1 then
SetTaskTemp(idtasktempp,GetTaskTemp(idtasktempp)+s el*100000)
morp()
elseif tang == 2 then
SetTaskTemp(idtasktempp,GetTaskTemp(idtasktempp)+s el*10000)
morp()
elseif tang == 3 then
SetTaskTemp(idtasktempp,GetTaskTemp(idtasktempp)+s el*1000)
morp()
elseif tang == 4 then
SetTaskTemp(idtasktempp,GetTaskTemp(idtasktempp)+s el*100)
morp()
elseif tang == 5 then
SetTaskTemp(idtasktempp,GetTaskTemp(idtasktempp)+s el*10)
morp()
elseif tang == 6 then
SetTaskTemp(idtasktempp,GetTaskTemp(idtasktempp)+s el*1)
morp1()
else
no()
end
elseif GetTaskTemp(idtasktempp2) == 1 then
if tang == 1 then
SetTaskTemp(idtasktempp,GetTaskTemp(idtasktempp)+s el*100000)
dmkp()
elseif tang == 2 then
SetTaskTemp(idtasktempp,GetTaskTemp(idtasktempp)+s el*10000)
dmkp()
elseif tang == 3 then
SetTaskTemp(idtasktempp,GetTaskTemp(idtasktempp)+s el*1000)
dmkp()
elseif tang == 4 then
SetTaskTemp(idtasktempp,GetTaskTemp(idtasktempp)+s el*100)
dmkp()
elseif tang == 5 then
SetTaskTemp(idtasktempp,GetTaskTemp(idtasktempp)+s el*10)
dmkp()
elseif tang == 6 then
SetTaskTemp(idtasktempp,GetTaskTemp(idtasktempp)+s el*1)
dmkp1()
else
no()
end
elseif GetTaskTemp(idtasktempp2) == 2 then
if tang == 1 then
SetTaskTemp(idtasktempp,GetTaskTemp(idtasktempp)+s el*100000)
dmkp2()
elseif tang == 2 then
SetTaskTemp(idtasktempp,GetTaskTemp(idtasktempp)+s el*10000)
dmkp2()
elseif tang == 3 then
SetTaskTemp(idtasktempp,GetTaskTemp(idtasktempp)+s el*1000)
dmkp2()
elseif tang == 4 then
SetTaskTemp(idtasktempp,GetTaskTemp(idtasktempp)+s el*100)
dmkp2()
elseif tang == 5 then
SetTaskTemp(idtasktempp,GetTaskTemp(idtasktempp)+s el*10)
dmkp2()
elseif tang == 6 then
SetTaskTemp(idtasktempp,GetTaskTemp(idtasktempp)+s el*1)
dmkp3()
else
no()
end
end
end
function hoanthanh()
local a,b,c,d,e,f = phantichpas(GetTask(idtaskruong))
danh_sach_ma[getn(danh_sach_ma)+1] = {GetName(),a..b..c..d..e..f} --Name,MaRuong
local danhsachma = TaoBang(danh_sach_ma,"danh_sach_ma","")
SaveData("script/ruong/list.lua",danhsachma)
Talk(1,"no","Ma Ruong Thiet Lap: "..a..b..c..d..e..f.." thanh cong")
end
function phantichpas(task) --- ham by chicken
--local x,len,a,b,c,d,e,f = GetTask(task),0,0,0,0,0,0,0
local x,len = task,0
local a,b,c,d,e,f = 0,0,0,0,0,0
x = tostring(x)
len = strlen(x)
if len < 6 then
for i=1,(6-len) do
x = "0"..x
end
end
a = tonumber(strsub(x,1,1))
b = tonumber(strsub(x,2,2))
c = tonumber(strsub(x,3,3))
d = tonumber(strsub(x,4,4))
e = tonumber(strsub(x,5,5))
f = tonumber(strsub(x,6,6))
return a,b,c,d,e,f
end;
function TaoBang(tTable, sTableName, sTab) --include cua manh tuyen
sTab = sTab or "";
sTmp = ""
sTmp = sTmp..sTab..sTableName.."={"
local tStart = 0
for key, value in tTable do
if tStart == 1 then
sTmp = sTmp..",\r\n"
else
sTmp = sTmp.."\r\n"
tStart = 1
end
local sKey = (type(key) == "string") and format("[%q]",key) or format("[%d]",key);
if(type(value) == "table") then
sTmp = sTmp..TaoBang(value, sKey, sTab.."\t");
else
local sValue = (type(value) == "string") and format("%q",value) or tostring(value);
sTmp = sTmp..sTab.."\t"..sKey.." = "..sValue
end
end
sTmp = sTmp.."\r\n"..sTab.."}"
return sTmp
end
function SaveData(file, string) ---Tuy ngan nhung wan trong nhat >''<
file_op = openfile( file, "w+" ) --- a+ la vit them hem xoa file dau -- w+ -- la che do doc ghi xoa file dau
write(file_op,string)
closefile(file_op)
end
\script\ruong\list.lua
danh_sach_ma={
[1]={
[1] = "Chicken5",
[2] = "000000"
},
[2]={
[1] = "Chicken4",
[2] = "123456"
},
[3]={
[1] = "Chicken4",
[2] = "000001"
}
}
Giờ tui share script pass rương này là để tạ tội với ae
Ai cần thì edit lại cho chuẩn rùi sài
Hàng cùi pắp ko xài thì đừng nói lời cay đắng tội em :(
Tuy nó ko có gì mới mẻ nhưng đc code lại với thuật toán rất ngắn :), sài nếu có bug thì post lên có gì mình sửa cho >:D<>:D<
\script\ruong\passruong.lua
-------------------------------------------------------------------------------
------------------ MAKE by chicken --------------------------------------------
-------------------- 29/8/2010 ------------------------------------------------
Include("\\script\\ruong\\list.lua"); --- duong dan toi script sai nho config lai cho chuan
idtaskruong = 133 ----- ID task ma ruong
idtasktempp = 157 ----- ID task luu ma ruong tam thoi
idtasktempp1 = 158 ---- ID Task so tang(floor)
idtasktempp2 = 159 ---- ID dieu kien lap mat khau va doi mat khau
tiendoipass = 50000 --- money change pass
function main()
SetTaskTemp(idtasktempp,0)
SetTaskTemp(idtasktempp1,0)
SetTaskTemp(idtasktempp2,0)
Say("<color=cyan>Ruong Chua Do:<color> Xin chao lu khach xin hoi nguoi muon gi ?",3,"Mo ruong chua do./morp","Doi mat khau[50v]./tgdmkp","Thoat./no");
end
function no()
SetTaskTemp(idtasktempp,0)
SetTaskTemp(idtasktempp1,0)
SetTaskTemp(idtasktempp2,0)
end;
function morp()
SetTaskTemp(idtasktempp2,0)
SetTaskTemp(idtasktempp1,GetTaskTemp(idtasktempp1) +1)
Say("<color=cyan>Ruong Chua Do:<color> Neu lu khach chua lap ma ruong, pass mac dinh se la : <color=green>000000<color>.\nBan hay nhap so thu : <color=blue>"..GetTaskTemp(idtasktempp1).."<color>",11,"0/luupass","1/luupass","2/luupass","3/luupass","4/luupass","5/luupass","6/luupass","7/luupass","8/luupass","9/luupass","Thoat./no");
end
function tgdmkp()
if GetCash() >= tiendoipass then
Pay(tiendoipass)
dmkp()
else
Talk(1,"no","Nguoi ko mang theo du tien ta can.")
end
end
function dmkp()
SetTaskTemp(idtasktempp2,1)
SetTaskTemp(idtasktempp1,GetTaskTemp(idtasktempp1) +1)
Say("<color=cyan>Ruong Chua Do:<color> Neu lu khach chua lap ma ruong, pass mac dinh se la : <color=green>000000<color>.\nMa ruong cu, ban hay nhap so thu : <color=blue>"..GetTaskTemp(idtasktempp1).."<color>",11,"0/luupass","1/luupass","2/luupass","3/luupass","4/luupass","5/luupass","6/luupass","7/luupass","8/luupass","9/luupass","Thoat./no");
end
function morp1()
local a,b,c,d,e,f = phantichpas(GetTask(idtaskruong))
local a1,b1,c1,d1,e1,f1 = phantichpas(GetTaskTemp(idtasktempp))
local tring1 = a..b..c..d..e..f -- chuoi ma ruong
local tring2 = a1..b1..c1..d1..e1..f1 -- chuoi ma ruong moi nhap(tuc thoi)
SetTaskTemp(idtasktempp,0)
SetTaskTemp(idtasktempp1,0)
SetTaskTemp(idtasktempp2,0)
if tring1 == tring2 then
OpenBox()
Msg2Player("Kiem tra ma ruong chinh xac.")
else
Talk(1,"no","Ban da nhap sai ma ruong.\nNeu quen thi ban co the lien he GM de lay lai.");
end
end
function dmkp1()
local a,b,c,d,e,f = phantichpas(GetTask(idtaskruong))
local a1,b1,c1,d1,e1,f1 = phantichpas(GetTaskTemp(idtasktempp))
local tring1 = a..b..c..d..e..f -- chuoi ma ruong
local tring2 = a1..b1..c1..d1..e1..f1 -- chuoi ma ruong moi nhap(tuc thoi)
SetTaskTemp(idtasktempp,0)
SetTaskTemp(idtasktempp1,0)
SetTaskTemp(idtasktempp2,0)
if tring1 == tring2 then
dmkp2()
else
Talk(1,"no","Ban da nhap sai ma ruong.\nNeu quen thi ban co the lien he GM de lay lai.");
end
end
function dmkp2()
SetTaskTemp(idtasktempp2,2)
SetTaskTemp(idtasktempp1,GetTaskTemp(idtasktempp1) +1)
Say("<color=cyan>Ruong Chua Do:<color> Ma ruong moi.\nBan hay nhap ma ruong thu : <color=blue>"..GetTaskTemp(idtasktempp1).."<color>",11,"0/luupass","1/luupass","2/luupass","3/luupass","4/luupass","5/luupass","6/luupass","7/luupass","8/luupass","9/luupass","Thoat./no");
end
function dmkp3()
local a1,b1,c1,d1,e1,f1 = phantichpas(GetTaskTemp(idtasktempp))
local tring2 = a1..b1..c1..d1..e1..f1 -- chuoi ma ruong moi nhap(tuc thoi)
SetTask(idtaskruong,tonumber(tring2))
hoanthanh()
end
function luupass(sel)
local tang = GetTaskTemp(idtasktempp1)
if GetTaskTemp(idtasktempp2) == 0 then
if tang == 1 then
SetTaskTemp(idtasktempp,GetTaskTemp(idtasktempp)+s el*100000)
morp()
elseif tang == 2 then
SetTaskTemp(idtasktempp,GetTaskTemp(idtasktempp)+s el*10000)
morp()
elseif tang == 3 then
SetTaskTemp(idtasktempp,GetTaskTemp(idtasktempp)+s el*1000)
morp()
elseif tang == 4 then
SetTaskTemp(idtasktempp,GetTaskTemp(idtasktempp)+s el*100)
morp()
elseif tang == 5 then
SetTaskTemp(idtasktempp,GetTaskTemp(idtasktempp)+s el*10)
morp()
elseif tang == 6 then
SetTaskTemp(idtasktempp,GetTaskTemp(idtasktempp)+s el*1)
morp1()
else
no()
end
elseif GetTaskTemp(idtasktempp2) == 1 then
if tang == 1 then
SetTaskTemp(idtasktempp,GetTaskTemp(idtasktempp)+s el*100000)
dmkp()
elseif tang == 2 then
SetTaskTemp(idtasktempp,GetTaskTemp(idtasktempp)+s el*10000)
dmkp()
elseif tang == 3 then
SetTaskTemp(idtasktempp,GetTaskTemp(idtasktempp)+s el*1000)
dmkp()
elseif tang == 4 then
SetTaskTemp(idtasktempp,GetTaskTemp(idtasktempp)+s el*100)
dmkp()
elseif tang == 5 then
SetTaskTemp(idtasktempp,GetTaskTemp(idtasktempp)+s el*10)
dmkp()
elseif tang == 6 then
SetTaskTemp(idtasktempp,GetTaskTemp(idtasktempp)+s el*1)
dmkp1()
else
no()
end
elseif GetTaskTemp(idtasktempp2) == 2 then
if tang == 1 then
SetTaskTemp(idtasktempp,GetTaskTemp(idtasktempp)+s el*100000)
dmkp2()
elseif tang == 2 then
SetTaskTemp(idtasktempp,GetTaskTemp(idtasktempp)+s el*10000)
dmkp2()
elseif tang == 3 then
SetTaskTemp(idtasktempp,GetTaskTemp(idtasktempp)+s el*1000)
dmkp2()
elseif tang == 4 then
SetTaskTemp(idtasktempp,GetTaskTemp(idtasktempp)+s el*100)
dmkp2()
elseif tang == 5 then
SetTaskTemp(idtasktempp,GetTaskTemp(idtasktempp)+s el*10)
dmkp2()
elseif tang == 6 then
SetTaskTemp(idtasktempp,GetTaskTemp(idtasktempp)+s el*1)
dmkp3()
else
no()
end
end
end
function hoanthanh()
local a,b,c,d,e,f = phantichpas(GetTask(idtaskruong))
danh_sach_ma[getn(danh_sach_ma)+1] = {GetName(),a..b..c..d..e..f} --Name,MaRuong
local danhsachma = TaoBang(danh_sach_ma,"danh_sach_ma","")
SaveData("script/ruong/list.lua",danhsachma)
Talk(1,"no","Ma Ruong Thiet Lap: "..a..b..c..d..e..f.." thanh cong")
end
function phantichpas(task) --- ham by chicken
--local x,len,a,b,c,d,e,f = GetTask(task),0,0,0,0,0,0,0
local x,len = task,0
local a,b,c,d,e,f = 0,0,0,0,0,0
x = tostring(x)
len = strlen(x)
if len < 6 then
for i=1,(6-len) do
x = "0"..x
end
end
a = tonumber(strsub(x,1,1))
b = tonumber(strsub(x,2,2))
c = tonumber(strsub(x,3,3))
d = tonumber(strsub(x,4,4))
e = tonumber(strsub(x,5,5))
f = tonumber(strsub(x,6,6))
return a,b,c,d,e,f
end;
function TaoBang(tTable, sTableName, sTab) --include cua manh tuyen
sTab = sTab or "";
sTmp = ""
sTmp = sTmp..sTab..sTableName.."={"
local tStart = 0
for key, value in tTable do
if tStart == 1 then
sTmp = sTmp..",\r\n"
else
sTmp = sTmp.."\r\n"
tStart = 1
end
local sKey = (type(key) == "string") and format("[%q]",key) or format("[%d]",key);
if(type(value) == "table") then
sTmp = sTmp..TaoBang(value, sKey, sTab.."\t");
else
local sValue = (type(value) == "string") and format("%q",value) or tostring(value);
sTmp = sTmp..sTab.."\t"..sKey.." = "..sValue
end
end
sTmp = sTmp.."\r\n"..sTab.."}"
return sTmp
end
function SaveData(file, string) ---Tuy ngan nhung wan trong nhat >''<
file_op = openfile( file, "w+" ) --- a+ la vit them hem xoa file dau -- w+ -- la che do doc ghi xoa file dau
write(file_op,string)
closefile(file_op)
end
\script\ruong\list.lua
danh_sach_ma={
[1]={
[1] = "Chicken5",
[2] = "000000"
},
[2]={
[1] = "Chicken4",
[2] = "123456"
},
[3]={
[1] = "Chicken4",
[2] = "000001"
}
}