• 0
Sign in to follow this  
Vinicius Lemonge

Me ajudem a criar

Question

estou precisando de um script para q posso fazer essa soma q varia as vezes na adição e subtração e tanto nos numeros 

script q responda sozinho e de click no ok  essa imagem aparece bem no centro da telaScreenshot_1.png

esse e o script q faz aparecer a janela no meio da tela se puderem fazer o mesmo script porem um q já responda a conta e de ok agradeço

 

AntibotWindow = nil
haveTiming = false
local function getTimeInString(interval)
    timeTable = {}
    timeTable.minute = math.floor((math.fmod(interval, 60*60))/60) 
    timeTable.second = math.fmod(math.fmod(interval, 60*60),60) 
    for i, v in pairs(timeTable) do
    if tostring(v):len() < 2 then
      timeTable = "0"..timeTable
      end
    end
    return timeTable.minute..":"..timeTable.second
end

local function attTimer(timeLeft)
    if not g_game.isOnline() or timeLeft == 0 then 
        haveTiming = false
        return
    end
    AntibotWindow:getChildById("Timer"):setText(getTimeInString(timeLeft))
    scheduleEvent(function() attTimer(timeLeft-1) end, 1000)
    haveTiming = true
end 

function onReceiveQuestion(protocol, opcode, buffer)
    if buffer == nil or not buffer then return false end 
    buffer = string.explode(buffer, ",")
    if not haveTiming then
        attTimer(buffer[2])
    end
    AntibotWindow:getChildById("Question"):setText(buffer[1])
    AntibotWindow:getChildById("Answer"):setText("")
    if not AntibotWindow:isVisible() then
        AntibotWindow:show()
    end
end

function onTestVisible(protocol, opcode, buffer)
    if not AntibotWindow:isVisible() then
        AntibotWindow:getChildById("Answer"):setText("")
        AntibotWindow:show()
    end
    if not haveTiming then
        attTimer(buffer)
    end
end

function init()  
 ProtocolGame.registerExtendedOpcode(167, onReceiveQuestion)
 ProtocolGame.registerExtendedOpcode(168, onTestVisible)

  AntibotWindow = g_ui.displayUI('antibot.otui')
          connect(g_game, { onGameStart = online,
                    onGameEnd = offline,
                    onGameEnd = destroyWindows})
    
 AntibotWindow:hide()
end


function destroyWindows()
AntibotWindow:hide()
end

function terminate()
disconnect(g_game, { onGameStart = online,
                       onGameEnd = offline,
                       onGameEnd = destroyWindows})
 
    AntibotWindow:destroy()

end

function toggle()

end

function sendQuestion()
AntibotWindow:hide()
return g_game.talkChannel(1, 0, "!antibot " .. AntibotWindow:getChildById("Answer"):getText())
end

 

ou se for mais facil um script q responda essa msg, precisa responder !antibot "resultado da conta"  sem aspas

msg aparecer no chat Screenshot_2.png  

por favor me ajudem :D

 

Edited by Vinicius Lemonge

Share this post


Link to post
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this