[RELEASE]] Automatic gaming quest

09/16/2011 16:25 cpsky#1
hello every one,i will share my gaming quest for you,if you like it,please give thanks.
sorry for my english.

PHP Code:
quest bocai begin
    state start begin
        when letter with pc 
is_gm ( ) begin
            send_letter 
"GM betting Settings" )
        
end
        
        when button 
or info begin
            say 
"gaming Settings" )
        
caidan select ("Automatic gaming system","Manual gaming system","Cancel")
        if 
caidan == 1 then
            sheding 
select ("activate the automatic gaming system""stop automatic gaming system""stop the current round of betting," "set the reward items," "bet Time Setting""Duijiang time setting""Cancel" 
                if 
sheding == 1 then
                    
if game get_event_flag "auto" ) >= 1 then
                        say 
"automatic system has been in active gaming" )
                    else
                        
say "gaming system is automatically activated." )
                        
game set_event_flag "auto" )
                        
server_timer "mex" )
                    
end
                    
                
elseif sheding == 2 then
                    say 
"automatic gaming system has stopped" )
                    
game set_event_flag "auto" )
                    
clear_server_timer "mex" )
                    
clear_server_timer "mex1" )
                    
                elseif 
sheding == 3 then
                    local aa 
number(19)
                    
local bb number(19)
                    
local cc number(19)
                    
game.set_event_flag("aa"aa)
                    
game.set_event_flag("bb"bb)
                    
game.set_event_flag("cc"cc)
                    
game.set_event_flag("caipiao"0)
                    
notice_all("the end of this round of betting.")
                    
notice_all("the ultimate winning numbers: "..aa.."-"..bb.." lucky number is:"..cc.."")
                    
                elseif 
sheding == 4 then
                    say_title
("Grand Prize award set!")
                    
say_reward("Please enter the Grand Prize item ID!")
                    
local wupin input() 
                    
say_reward("Please enter a display name of reward.")
                    
local shuliang input() 
                        
say_reward("Grand Prize award items is:")
                        
say_item(" "wupin" ")
                        
say("[COLOR r;0|g;1|b;0.2]                  "..shuliang.."X 1个[/COLOR]")
                        
say("")
                        
say("")
                        
local js select("OK""Cancel")
                            if 
js == 1 then
                                game
.set_event_flag("wupin"wupin)
                                
game.set_event_flag("shuliang"shuliang)
                            else
                                
say_title("Please re-enter the Grand Prize award!")
                            
end
                    
                
elseif sheding == 5 then
                    say 
"Please enter a bet every time the value:" )
                    
tonumber(input())
                        if 
== nil then
                            say 
"You must enter the number" )
                        elseif 
1 then
                            say 
"You must enter the number greater than 0" )
                        else
                            
select "seconds" "minute" "hour" )
                                if 
== 1 then
                                    t 
m
                                
elseif == 2 then
                                    t 
tonumber(60)
                                elseif 
== 3 then
                                    t 
tonumber(60 60)
                                
end
                        end
                
                
elseif sheding == 6 then
                    say 
"Please enter Duijiang time interval values:" )
                    
tonumber(input())
                        if 
== nil then
                            say 
"You must enter the number" )
                        elseif 
1 then
                            say 
"You must enter the number greater than 0" )
                        else
                            
h1 select "seconds" "minute" "hour" )
                                if 
h1 == 1 then
                                    t1 
n
                                
elseif == 2 then
                                    t1 
tonumber(60)
                                elseif 
== 3 then
                                    t1 
tonumber(60 60)
                                
end
                        end
                end
        
elseif caidan == 2 then
            say
("Manual Gaming System")
        else
        
end    
        end
        
        when mex
.server_timer begin
            
if game.get_event_flag "auto" ) == 1 then
                notice_all
("a new round of betting has been opened!")
                
notice_all("Players can bet the city of the NPC。")
                
game.set_event_flag("caipiao"1)
                
game.set_event_flag ("yideng"0)
                
game.set_event_flag ("erdeng"0)
                
game.set_event_flag ("tedeng"0)
            
server_timer "mex1" )
            else
            
end
        end

        when mex1
.server_timer begin
            
if game get_event_flag "auto" ) == 1 then
                local aa 
number(19)
                
local bb number(19)
                
local cc number(19)
                
game.set_event_flag("aa"aa)
                
game.set_event_flag("bb"bb)
                
game.set_event_flag("cc"cc)
                
game.set_event_flag("caipiao"0)
                
notice_all("the end of this round of betting.")
                
notice_all("the ultimate winning numbers: "..aa.."-"..bb.." lucky number is:"..cc.."")
            
server_timer "mex" t1 )
            else
            
end
         end

        when 11001.chat
."betting" with game.get_event_flag("caipiao") == 1 begin
            say_title
("betting!")
            
say("Rule description:")
            
say("betting round choice two ordinary numbers and a lucky number.")
            
say("[COLOR r;0|g;1|b;0.2]each round of betting the amount of 10,000,000.[/COLOR]")
            
say("number range is 1-9.")
            
say("[COLOR r;1.2|g;0.4|b;0.4]whether to continue?[/COLOR]")
            
local xuanze select("OK""Cancel")
                if 
xuanze == 1 then
                                
        
if pc gold 10000000 then 
            pc
.setqf("a"0)
            
pc.setqf("b"0)
            
pc.setqf("c"0)
            
say_title("betting!")
            
say("Rule description:")
            
say("betting round choice two ordinary numbers and a lucky number.")
            
say("[COLOR r;0|g;1|b;0.2]each round of betting the amount of 10,000,000.[/COLOR]")
            
say("number range is 1-9.")
            
say("[COLOR r;1.2|g;0.4|b;0.4]Enter the first number(1-9).[/COLOR]")
            
local a input() 
            
say_title("betting!")
            
say("Rule description:")
            
say("betting round choice two ordinary numbers and a lucky number.")
            
say("[COLOR r;0|g;1|b;0.2]each round of betting the amount of 10,000,000.[/COLOR]")
            
say("number range is 1-9.")
            
say_reward("you choose the first number: "..a.."")
            
say("[COLOR r;1.2|g;0.4|b;0.4]Please enter the second number(1-9).[/COLOR]")
            
local b input() 
            
say_title("betting!")
            
say("Rule description:")
            
say("betting round choice two ordinary numbers and a lucky number.")
            
say("[COLOR r;0|g;1|b;0.2]each round of betting the amount of 10,000,000.[/COLOR]")
            
say("number range is 1-9.")
            
say_reward("you choose the first number: "..a.."")
            
say_reward("you choose the second number: "..b.."")
            
say("[COLOR r;1.2|g;0.4|b;0.4]Please, enter your lucky numbers(1-9).[/COLOR]")
            
local c input() 
            
say_title("betting!")
            
say("Rule description:")
            
say("betting round choice two ordinary numbers and a lucky number.")
            
say("[COLOR r;0|g;1|b;0.2]each round of betting the amount of 10,000,000.[/COLOR]")
            
say("number range is 1-9.")
            
say("[COLOR r;1|g;0|b;1]you choose the first number: "..a.."[/COLOR]")
            
say("[COLOR r;1|g;0|b;1]you choose the second number: "..b.."[/COLOR]")
            
say("[COLOR r;1|g;0|b;1]your lucky number is:   "..c.."[/COLOR]")
            
say("")
            
say("[COLOR r;1|g;1|b;0]Please confirm whether the bet, if confirmed, will directly deduct the amount bet[/COLOR]")
            
local tz select("sure bet""rebet")
                if 
tz == 1 then
                    say
("[COLOR r;1|g;1|b;0]betting success! [/COLOR]")
                    
pc.setqf("a"a)
                    
pc.setqf("b"b)
                    
pc.setqf("c"c)
                    
pc.setqf("d"1)
                    
pc change_money ( - 10000000 )
                else
                    
say_title("Please reenter the betting number!")
                
end
        
else
            
say("betting needs 10,000,000 gold every time.")
        
end
                
else
                    
say_title("Welcome to your next bet!")
                
end
        end        

        when 11001.chat
."prize pool exchange"  with game.get_event_flag("caipiao") == 0 begin
            say_title
("round of betting is over.")
            
say_reward("the ultimate winning numbers: "..game.get_event_flag("aa").."-"..game.get_event_flag("bb").." lucky number is:"..game.get_event_flag("cc").."")
                
say("You choose the number ultimately: "..pc.getqf("a").."-"..pc.getqf("b").."lucky number is:"..pc.getqf("c").."")
                
say("")
                
local a1 pc.getqf("a")
                
local b1 pc.getqf("b")
                
local c1 pc.getqf("c")
                
local aa1 game.get_event_flag("aa")
                
local bb1 game.get_event_flag("bb")
                
local cc1 game.get_event_flag("cc")
                
local wupin1 game.get_event_flag("wupin")
                
local shuliang1 game.get_event_flag("shuliang")
                
            if 
pc.getqf("d") == 1 then    
                
if a1 == aa1 then
                    
if b1 == bb1 and c1 != cc1 then
                        say
("Congratulations! the first prize")

                        
game set_event_flag "yideng" game get_event_flag "yideng" ) + )
                        
pc.setqf("d"0)
                    return
                    elseif 
b1 == bb1 and c1 == cc1 then
                        say 
("Congratulations! in the Grand Prize"

                        
pc.give_item2(wupin1,shuliang1)
                        
game set_event_flag "tedeng" game get_event_flag "tedeng" ) + 
                        
pc.setqf("d"0)
                    return
                    else
                        
say ("Congratulations! in the second prize."

                        
game set_event_flag "erdeng" game get_event_flag "erdeng" ) + )
                        
pc.setqf("d"0)
                    return
                    
end

                
elseif a1 != aa1 then
                    
if b1 == bb1 and c1 != cc1 then
                        say 
("Congratulations! in the second prize."

                        
game set_event_flag "yideng" game get_event_flag "yideng" ) + )
                        
pc.setqf("d"0)
                        return
                    else
                        
say ("Too bad you did not win"
                    
end
                    
                
elseif a1 == bb1 then
                    
if b1 == aa1 and c1 != cc1 then
                        say 
("Congratulations! the first prize"
                        
game set_event_flag "yideng" game get_event_flag "yideng" ) + )
                        
pc.setqf("d"0)
                    return
                    elseif 
b1 == aa1 and c1 == cc1 then
                        say 
("Congratulations! in the Grand Prize"
                        
pc.give_item2(wupin1,shuliang1)
                        
game set_event_flag "tedeng" game get_event_flag "tedeng" ) + 
                        
pc.setqf("d"0)
                    return
                    else
                        
say ("Congratulations! in the second prize."
                        
game set_event_flag "erdeng" game get_event_flag "erdeng" ) + )
                        
pc.setqf("d"0)
                    return
                    
end
                
else 
                    
say ("Too bad you did not win"
                
end
                
                
elseif b1 != bb1 then
                    
if a1 == aa1 and c1 != cc1 then
                        say 
("Congratulations! in the second prize."
                        
game set_event_flag "yideng" game get_event_flag "yideng" ) + )
                        
pc.setqf("d"0)
                        return
                    else
                        
say ("Too bad you did not win"
                    
end

                
            
else
                
say ("you have not been betting or have already received the award."
            
end
        end          

        when 11001.chat
."grand prize round of betting inquiry"  with game.get_event_flag("caipiao") == 0 begin
            local wupin2 
game.get_event_flag("wupin")
            
local shuliang2 game.get_event_flag("shuliang")
            
local name1 game.get_event_flag("name")
            
say_title ("Grand Prize award check!")
            
say_reward ("Grand Prize of the current round of awards is:"
            
say_item(" "wupin2"")
            
say("[COLOR r;1|g;1|b;0]                        1个[/COLOR]")
            
say("")
            
say_reward("Second Prize have:       "..game.get_event_flag("erdeng").."")
            
say_reward("the first prize have:       "..game.get_event_flag("yideng").."")
            
say_reward("Grand Prize have:       "..game.get_event_flag("tedeng").."")
            
say("")

        
end    
        
    end
end 
09/16/2011 17:38 TheDestroyer™#2
haha bro. its best
09/16/2011 17:44 cpsky#3
i write it some months ago.and didn't test it.maybe it has some bugs
09/16/2011 18:00 .Raicon#4
What will the Quest do?

I cant understand it, jet...
09/16/2011 19:18 tr0j3n18#5
nice bro thanks
09/16/2011 20:44 FbFunnY#6
very nice quest
09/16/2011 20:52 TheDestroyer™#7
haha chen | I love U :D:D:D
09/17/2011 01:23 KIDStAaR#8
Quest hat zwar ein paar Bugs aber wayne^^
09/17/2011 02:40 .Flynn.#9
was bringt die Quest denn?
mfg
Flynn
09/17/2011 03:16 •kяyteя•#10
Also das würd ich auch gern ma wissen...
can you say what will the quest do?
10/29/2011 12:45 xmansasx#11
Ist das sowas wie Lotto? :D
07/26/2012 05:35 .Hany#12
sorry but, what's the idea of this quest, what this quest is for/about?
07/26/2012 05:42 •kяyteя•#13
Quote:
Originally Posted by xmansasx View Post
Ist das sowas wie Lotto? :D
Ja, sieht ganz danach aus ^^

Quote:
Originally Posted by .Hany View Post
sorry but, what's the idea of this quest, what this quest is for/about?
looks like the lottery and I guess it should be.
It works automatically.