Rews
Senior User
- Joined
- Aug 19, 2010
- Messages
- 949
- Reaction score
- 64
Funkcja skryptu: Kasyno depot (north-west) Czyli nasz spot musi znajdowa? si? u g?ry po lewo.
Nazwa bota: Xenobot >.<
Setup:
1. W??? do depo chest: Zaoan chess box(z cc) i golden backpack (pusty).
2. Otw?rz tylko te dwa backpacki, a reszte jak masz otwarte zamknij.
3. Po??? kostk? na depo.
4. Odpal skrypt w xenobocie.
*Skrypt dzia?a tylko na HEXERA.NET - tak mi si? wydaje. Mo?ecie sprawdzi? i da? info co i jak.
I wszystko gotowe, nasz skrypt dzia?a. Du?ych zarobk?w!
Nazwa bota: Xenobot >.<
Code:
BetCashBP = "Golden Backpack"
MoneyBP = "Zaoan Chess Box"
Bet =
{
Value = 0, -- nie konfigurowalne
min = 10, -- w cc 5 = 5cc
max = 50, -- w cc 100 = 1kk
}
payo = 1 -- 1 == 100% , 0.8 == 80%
yellActive = true
yellMessage = ("Min. [100K] - Max. [500K] -Cast is ON.")
info = 'Min: ' .. Bet.min*10 .. "k. Max: " .. Bet.max*10 .. "k. H or L - example 100 h"
print('Froskurek\'s casino bot.\n Thanks for subscribe.\n Enjoy.')
cashposx = Self.Position().x
cashposy = Self.Position().y
cashposz = Self.Position().z
Players = {}
Rolls = {}
cc = 3043
Balance = 0
Gambler_Name = ""
money = Self.ItemCount(cc)
cash = Self.ItemCount(cc)
Players = {}
Rolls = {}
AntiSpamTimer = os.clock()
function AntiSpam(message, type)
if os.difftime(os.clock(), AntiSpamTimer) >= 1.3 then
Self.Speak(message, type)
AntiSpamTimer = os.clock()
end
end
function onSpeak(channel, msg)
if msg == 'balance' then
channel:SendOrangeMessage('DiceBot', Gambler_Name .. '\'s balance is ' .. Balance)
end
if msg == 'info' then
channel:SendOrangeMessage('DiceBot', "Bet.min = " .. Bet.min)
channel:SendOrangeMessage('DiceBot', "Bet.max = " .. Bet.max)
channel:SendOrangeMessage('DiceBot', "Gambler_Name = " .. Gambler_Name)
channel:SendOrangeMessage('DiceBot', "Balance = " .. Balance)
end
end
function onClose(channel, msg)
print("Leaving channel")
end
channel = Channel.New('DiceBot log', onSpeak, onClose)
Module.New('Casino_Turn', function(Mod)
Casino_Loaded = true
if (Casino_Loaded) then
Player_Detected = false
for name, creature in Creature.iPlayers(2) do
if (creature:Position().x == Self.Position().x + 2 and creature:Position().y == Self.Position().y and creature:Position().z == Self.Position().z) then
Player_Detected = true
if Gambler_Name ~= creature:Name() and not table.contains(Players, Gambler_Name) then
table.insert(Players, Gambler_Name)
for i = 1, #Players do
print(Players[i])
end
end
Gambler_Name = creature:Name()
if (creature:Position().x < Self.Position().x) then
cashposx = Self.Position().x - 1
cashposy = Self.Position().y - 1
cashposz = Self.Position().z
if (Self.LookDirection() ~= WEST) then
Self.Turn(WEST)
end
elseif (creature:Position().x > Self.Position().x) then
cashposx = Self.Position().x + 1
cashposy = Self.Position().y - 1
cashposz = Self.Position().z
if (Self.LookDirection() ~= EAST) then
Self.Turn(EAST)
welcomemsg = ("Hello " .. Gambler_Name .. "\nMIN " .. Bet.min * 10 .. "K. MAX " .. Bet.max *10 .. " k.\n say: info\n NOW 100% PAYOUT!! ")
AntiSpam(welcomemsg, SPEAK_SAY)
end
else
if (creature:Position().y < Self.Position().y) then
if (Self.LookDirection() ~= NORTH) then
Self.Turn(NORTH)
end
elseif (creature:Position().y > Self.Position().y) then
if (Self.LookDirection() ~= SOUTH) then
Self.Turn(SOUTH)
end
else
print('Casino: Error. Self character is the potential gambler.')
end
end
break
end
end
if not (Player_Detected) then
Balance = 0
if (Self.LookDirection() ~= SOUTH) then
yellDelay = os.time()
Self.Turn(SOUTH)
Balance = 0
Self.Say("Goodbye")
end
end
end
Mod:Delay(1400)
end)
EffectMessageProxy.OnReceive("DiceSignal", function(proxy, message, x, y, z)
roll = string.match(message, Self.Name().." rolled a (.+).")
if roll then
dice = Signal.New('Dice')
dice:Send(roll)
end
end)
Module.New('Check-Bet', function(mod)
BetBP = Container.New(BetCashBP)
CashBP = Container.New(MoneyBP)
if (Map.GetTopMoveItem(cashposx, cashposy, cashposz).id == cc and not withdraw) then
Casher = true
d = (Map.GetTopMoveItem(cashposx, cashposy, cashposz)).count
Map.PickupItem(cashposx, cashposy, cashposz, BetBP:Index(), 0)
wait(1000)
print(BetBP:CountItemsOfID(cc))
Bet.Value = BetBP:CountItemsOfID(cc)
Balance = Balance + Bet.Value
BetBP:MoveItemToContainer(0, CashBP:Index(), 0)
-- AntiSpam("Bot added " .. Bet.Value * 10 .. " k to your balance. Your balance is " .. Balance * 10 .. "k.", SPEAK_SAY)
channel:SendOrangeMessage('DiceLog', 'Bot added ' .. Bet.Value *10 .. 'k on ' .. Gambler_Name .. '\'s balance and its ' .. Balance *10 .. 'k.')
print('Bet Value is ' .. Bet.Value * 10 .. " " .. Gambler_Name .. " balance is " .. Balance * 10)
Casher = false
Bet.Value = 0
wait(500)
end
mod:Delay(1200)
end)
LocalSpeechProxy.OnReceive('bet', function(proxy, mtype, speaker, level, text)
Cyfra = text:match('%d+')
Litera = text:match('%a+')
if speaker == Gambler_Name and Cyfra ~= nil and Litera ~= "" then
Cyfra1 = tonumber(Cyfra) + 0
if table.isStrIn({'l', 'h'}, Litera) and Cyfra ~= nil then
print(Cyfra1 .. " " .. Litera)
if Cyfra1 >= Bet.min * 10 and Cyfra1 <= Bet.max * 10 and Balance >= Cyfra1 / 10 and Litera == "h" or Litera == "l" and speaker == Gambler_Name then
ValidBet = true
playerBet = Cyfra1
playerType = Litera
print('valid ' .. playerBet .. 'valid ' .. playerType)
else
ValidBet = false
end
else
ValidBet = false
end
end
if Cyfra == nil or Cyfra == 0 and Litera == "" then
ValidBet = false
end
end)
LocalSpeechProxy.OnReceive('Balance', function(proxy, mtype, speaker, level, text)
if speaker == Gambler_Name and text:lower() == 'balance' then
AntiSpam('Your balance: ' .. Balance *10 .. " k.", SPEAK_SAY)
end
end)
LocalSpeechProxy.OnReceive('BalanceRolls', function(proxy, mtype, speaker, level, text)
if speaker == Gambler_Name and ValidBet then
print(playerBet .. " playerBet " .. "playerType " .. playerType)
if playerType:lower() == 'h' and playerBet / 10 >= Bet.min and playerBet / 10 <= Bet.max and Balance ~= 0 and playerBet /10 <= Balance and ValidBet == true and not Bett then
Bett = true
Self.UseItemFromGround(Self.Position().x, Self.Position().y -1, Self.Position().z)
Signal.OnReceive('Dice', function(signal, data)
if (data == "4" or data == "5" or data == "6") and playerType:lower() == 'h' and playerBet / 10 >= Bet.min then
Self.UseItemFromEquipment('head')
Self.UseItemFromEquipment('head')
Balance = math.floor(Balance + ((playerBet / 10) * payo))
AntiSpam("YourType: " .. playerType:upper() .. ". You Won: " .. math.floor(playerBet * payo) .. ".\nBalance: " .. Balance * 10 .. " k." , SPEAK_SAY)
channel:SendYellowMessage('DiceLog', Gambler_Name .. ": " .. playerType .. ' . Bet: ' .. playerBet .. ' Won:' .. playerBet .. ' Balance = ' .. Balance * 10)
print('won')
Bett = false
else
Bett = true
Balance = math.floor(Balance - playerBet / 10)
AntiSpam( "YourType: " .. playerType:upper() .. ". You Lost: " .. playerBet .. ".\nBalance: " .. Balance *10 .. ' k.', SPEAK,SAY)
channel:SendOrangeMessage('DiceLog', Gambler_Name .. ": " .. playerType .. ' . Bet: ' .. playerBet .. ' Lost:' .. playerBet .. ' Balance = ' .. Balance * 10)
print("lost")
Bett = false
end
end)
elseif playerType:lower() == 'l' and playerBet / 10 >= Bet.min and playerBet / 10 <= Bet.max and playerBet /10 <= Balance and Balance ~= 0 and ValidBet == true and not Bett then
-- browse:UseItem(0)
Bett = true
Self.UseItemFromGround(Self.Position().x, Self.Position().y -1, Self.Position().z)
Signal.OnReceive('Dice', function(signal, data)
if (data == "1" or data == "2" or data == "3") and playerType:lower() == 'l' and playerBet /10 >= Bet.min then
Self.UseItemFromEquipment('head')
Self.UseItemFromEquipment('head')
Balance = math.floor(Balance + ((playerBet / 10)*payo))
AntiSpam( "YourType: " .. playerType:upper() .. ". You Won: " .. math.floor(playerBet * payo) .. ".\nBalance: " .. Balance * 10 .. " k." , SPEAK_SAY)
channel:SendYellowMessage('DiceLog', Gambler_Name .. ": " .. playerType .. ' . Bet: ' .. playerBet / 1.2 .. ' Won:' .. playerBet * 0.8 .. ' Balance = ' .. Balance * 10)
Bett = false
print('won')
else
Bett = true
Balance =math.floor(Balance - playerBet / 10)
AntiSpam( "YourType: " .. playerType:upper() .. ". You Lost: " .. playerBet .. ".\nBalance: " .. Balance *10 .. ' k.' , SPEAK_SAY)
channel:SendOrangeMessage('DiceLog', Gambler_Name .. ": " .. playerType .. ' . Bet: ' .. playerBet .. ' Lost:' .. playerBet .. ' Balance = ' .. Balance * 10)
print("lost")
Bett = false
end
end)
end
elseif speaker == Gambler_Name and not ValidBet then
if text:lower() == 'h' and Balance >= Bet.min and Balance <= Bet.max and not Bett then
Bett = true
Self.UseItemFromGround(Self.Position().x, Self.Position().y -1, Self.Position().z)
Signal.OnReceive('Dice', function(signal, data)
if (data == "4" or data == "5" or data == "6") and text:lower() == 'h' then
Self.UseItemFromEquipment('head')
Self.UseItemFromEquipment('head')
Balance = math.floor(Balance + (Balance * payo))
AntiSpam("YourType: " .. text:upper() .. ". You Won: " .. Balance * 10 .. ".\nBalance: " .. Balance * 10 .. " k." , SPEAK_SAY)
channel:SendYellowMessage('DiceLog', Gambler_Name .. ": " .. text:upper() .. ' . Bet: ' .. Balance * 10 .. ' Won:' .. Balance * 10 .. ' Balance = ' .. Balance * 10)
Bett = false
print('won')
else
Bett = true
cash = money + Balance
AntiSpam( "YourType: " .. text:upper() .. ". You Lost: " .. Balance * 10 .. " k.\nBalance: 0 k.", SPEAK,SAY)
Balance = 0
channel:SendOrangeMessage('DiceLog', Gambler_Name .. ": " .. text:upper() .. ' . Bet: ' .. Balance * 10 .. ' Lost:' .. Balance * 10 .. ' Balance = 0' )
print("lost")
Bett = false
end
end)
elseif text:lower() == 'l' and Balance >= Bet.min and Balance <= Bet.max and not Bett then
Bett = true
Self.UseItemFromGround(Self.Position().x, Self.Position().y -1, Self.Position().z)
Signal.OnReceive('Dice', function(signal, data)
if (data == "1" or data == "2" or data == "3") and text:lower() == 'l' then
Self.UseItemFromEquipment('head')
Self.UseItemFromEquipment('head')
Balance = math.floor(Balance + (Balance * payo))
AntiSpam("YourType: " .. text:upper() .. ". You Won: " .. Balance * 10 .. ".\nBalance: " .. Balance * 10 .. " k." , SPEAK_SAY)
channel:SendYellowMessage('DiceLog', Gambler_Name .. ": " .. text:upper() .. ' . Bet: ' .. Balance .. ' Won:' .. Balance * 10 .. ' Balance = ' .. Balance * 10)
Bett = false
print('won')
else
Bett = true
AntiSpam( "YourType: " .. text:upper() .. ". You Lost: " .. Balance * 10 .. " k.\nBalance: 0 k.", SPEAK,SAY)
Balance = 0
channel:SendOrangeMessage('DiceLog', Gambler_Name .. ": " .. text:upper() .. ' . Bet: ' .. Balance * 10 .. ' Lost:' .. Balance * 10 .. ' Balance = 0' )
print("lost")
Bett = false
end
end)
end
end
end)
LocalSpeechProxy.OnReceive('slotmachine' , function(proxy, speaker, mtype, level, text)
if Player_Detected then
if Gambler_Name == "Wemx" or Gambler_Name == "Everek" and text:lower() == '>' then
Self.DropItem(Self.Position().x + 1, Self.Position().y - 1, Self.Position().z, 3043)
end
end
end)
LocalSpeechProxy.OnReceive('withdraw', function(proxy, mtype, speaker ,level ,text)
if not Casher then
if (speaker:lower() == Gambler_Name:lower() and Balance ~= 0 ) and not withdraw then
if (text:lower() == 'pay' or text:lower() == '>' or text:lower() == 'payout' or text:lower() == 'payo' or text:lower() == 'withdraw' or text:lower() == '<') then
withdraw = true
Self.DropItem(cashposx, cashposy, cashposz, cc, Balance)
channel:SendOrangeMessage('DiceLog', 'Moved ' .. Balance .. " Crystal Coins onto " .. Gambler_Name .. '\'s locker.')
Balance = 0
AntiSpam( 'Your balance is equal to ' .. Balance .. ", You should charge your account", SPEAK_SAY)
wait(5000)
withdraw = false
end
end
end
end)
LocalSpeechProxy.OnReceive('info', function(proxy, mtype, speaker, level, text)
if (speaker == Gambler_Name and text:lower() == 'info') then
AntiSpam(info , SPEAK_SAY)
end
end)
Module.New('Yelling', function(mod)
if yellActive then
if not Player_Detected then
-- Timer2 = yellDelay
local Spam2 = os.difftime(os.time(), Timer2)
if Spam2 >= 120 then
Self.Yell(yellMessage)
Timer2 = os.time()
end
end
end
mod:Delay(1400)
end)
Setup:
1. W??? do depo chest: Zaoan chess box(z cc) i golden backpack (pusty).
2. Otw?rz tylko te dwa backpacki, a reszte jak masz otwarte zamknij.
3. Po??? kostk? na depo.
4. Odpal skrypt w xenobocie.
*Skrypt dzia?a tylko na HEXERA.NET - tak mi si? wydaje. Mo?ecie sprawdzi? i da? info co i jak.
I wszystko gotowe, nasz skrypt dzia?a. Du?ych zarobk?w!