Kako
Contributors
Posts: 105
|
Post by Kako on Jun 23, 2016 18:36:21 GMT
I guess the subject says it all, im trying to make scripts for a game, and im getting the hang of it, i was able to make a very basic function work, with lots of screens to move, but my real problem is, what to do if the pattern changes and a sudden screen appears, the most common being a connection error. Thanks! Here's what I did: take a screenshot of the connection error and make my script press the "reconnect" button (or whatever comes up in your case). I assume you're talking about a in-game connection error?
|
|
Kako
Contributors
Posts: 105
|
Post by Kako on Jun 23, 2016 19:14:26 GMT
Yes, exactly, but how do i make my script detect it on any screen, then click on the retry and try the last function again? because it will probably go out of sync and when that happens only a manual restart will work. Oh! Yeah, I had that also at first. But then I did a complete rewrite of my script. Now I can start it anywhere and it will pick-up where it left. So when it detects this kind of error, it recovers just fine. You'll need to determine something unique for every screen (most of the time, the button you want to press is enough). while 1 do firstThingToSearchFor = firstRegion:exists(sumtin) usePreviousSnap(true) -- ========== screen: first screen =========== if firstThingToSearchFor ~= nil then toast("Screen: first screen") usePreviousSnap(false) -- do whatever needs to be done on this screen
-- ========== screen: second screen =========== elseif secondRegion:exists(simtinels) ~= nil then toast("Screen: second screen") usePreviousSnap(false) -- do whatever needs to be done on this screen, for example: click(secondRegion:getLastMatch()) -- ========== screen: connection time-out =========== elseif reconnectButtonRegion:exists(reconnectButtonPattern) ~= nil then toast("Screen: connection error") usePreviousSnap(false) click(reconnectButtonRegion:getLastMatch()) else toast("Screen: No match") usePreviousSnap(false) sleep(4) -- wait some extra time, probably a loading screen end sleep(1) -- wait one second, and try all matches again end
May I ask what game you are making a script for?
|
|
|
Post by tinotk on Jun 24, 2016 5:21:58 GMT
Yes, exactly, but how do i make my script detect it on any screen, then click on the retry and try the last function again? because it will probably go out of sync and when that happens only a manual restart will work. How about using a global var to keep track of current function? Then in the main function you can check for the disconnect picture and call appropriate function based on the var. For instance: cf = nil -- var to keep value for last called function disconnected = Pattern("blablahblah.png")
function foo(bar) toast(bar) cf = 1 end
function foo2() toast("foo2 is called") cf = 2 end
function foo3() toast("foo3 is called") cf = 3 end
blah blah blah
if(disconnected) then -- ooops internet dropped if(cf == 1) then foo(bar) elseif(cf == 2) then foo2() elseif(cf == 3) then foo3() else .... end
another approach is if your functions are short and don't have parameters and easily to combine into one single function you can do all the if-else in that single function then make a call using the variable as your function parameter. For e.g.: cf = nil -- var to keep value for last called function
disconnected = Pattern("blablahblah.png")
function foo(current_function) if(exists(something) or (current_function==1) ) then -- first function do things cf=1 elseif(exists(sumting) or (current_function==2)) then --2nd function do that cf=2 elseif(exists(somting) or (current_function==3)) then --3rd function do gf cf=3 else end end
... if(disconnected) then foo(cf) end
Also, I noticed among the Advanced methods, there's one called startApp() which might be useful in your case if you find that a restart work better. You can give it a try. I've never used that function before so I can't give you any advice.
|
|
Kako
Contributors
Posts: 105
|
Post by Kako on Jun 24, 2016 8:48:27 GMT
Yes, exactly, but how do i make my script detect it on any screen, then click on the retry and try the last function again? because it will probably go out of sync and when that happens only a manual restart will work. Also, I noticed among the Advanced methods, there's one called startApp() which might be useful in your case if you find that a restart work better. You can give it a try. I've never used that function before so I can't give you any advice. I've started using startApp(). It won't work on in-game error-dialogs, because it won't "restart" the app (any open app will remain open). Ironically, for me it even paused my game: apparently the game detects this kind of intent and pauses itself It's a really handy function if you've got a game that crashes though!
|
|
|
Post by jakethesnake on Jul 17, 2016 18:40:35 GMT
This is what I have so far. Google translate did shift some of the code around, so its not a pretty as the original (it may have broke some of the code also?). Now all I need to do is re-do all the images.
-- =========== Setting ============
Settings: setCompareDimension (true, 1080) -- perform graphics resolution than when firefly degree. Set width or height based on the value of compareByWidth
Settings: setScriptDimension (true, 1080) -- for reference in the script resolution coordinate position App
Settings: set ( "MinSimilarity", 0.8)
setContinueClickTiming (10, 100) -- int downMs: Press milliseconds --int intervalMs: click the adjacent interval milliseconds
setDragDropTiming (400, 800) --downMs: Before you start moving hid Fixed a few milliseconds upMs: finally stopped a few milliseconds before release
setDragDropStepCount (3) --stepCount: From the starting point to the destination mobile After a few minutes
setDragDropStepInterval (100) --intervalMs: each move between a few milliseconds to stay
screen = getAppUsableScreenSize ()
screenX = screen: getX ()
screenY = screen: getY ()
dialogInit () -- New dialog
--addCheckBox ( "DEBUG", "Debug mode", false)
DEBUG = false
addTextView( "◆ number of executions:") addEditNumber ( "CLEAR_LIMIT", 999) newRow ()
addTextView( "Wait (min) ◆ insufficient physical:") addEditNumber ( "WAIT_TIME", 3) newRow ()
--addCheckBox ( "ITEM_MAKE", "check the props, Frequency: Every", false) addEditNumber ( "MAKE_ROUND", 2) addTextView ( "back") newRow ()
--addCheckBox ( "WEAPON_ON", "forging", false) --addEditNumber ( "WEAPON_POS", 1)
--addCheckBox ( "ABILITY_ON", "skills", false) --addEditNumber ( "ABILITY_POS", 1)
--addCheckBox ( "ITEM_ON", "blending", false) --addEditNumber ( "ITEM_POS", 1) newRow ()
ITEM_MAKE = false MAKE_ROUND = 0 WEAPON_ON = false ABILITY_ON = false ITEM_ON = false
addCheckBox ( "FAST_MODE", "fast mode", true) addTextView ( "Level select:") addEditNumber ( "QUEST", 1) newRow ()
addCheckBox ( "CONTINUE_CLICK", "Use Continue Click at the end", true) newRow ()
addTextView ( "or Click several times:") addEditNumber ( "CLICK_TIMES", 9) newRow ()
addCheckBox ( "AUTO_BATTLE", "auto battle", true) addTextView ( "or action member (1 ~ 6)") addEditNumber ( "ATTACKER", 6) newRow ()
--addTextView ( "used in combat:")
--addCheckBox ( "USE_SUMMON", "summon", false)
--addCheckBox ( "USE_ITEM", "props", false)
--addCheckBox ( "USE_ABILITY", "skills", false) newRow ()
USE_SUMMON = false USE_ITEM = false USE_ABILITY = false
addCheckBox ( "FRIEND", "application of new friends", false) addEditNumber ( "FRIEND_LOOP", 9) addTextView ( "back") newRow ()
addCheckBox ( "BUY", "use the gem recuperate", false) addEditNumber ( "BUY_LOOP", 2) addTextView ( "back") newRow ()
dialogShow ( "Trust Master Maker" .. "-" ..screenX .. "×" ..screenY)
-- =========== Region set ==============
-- 1080 x 1920 (x, y, w, h)
X = 1080 -- 1080/540/270/135
Y = 1920 -- 1920/960/480/240
-- 1/2
upper = Region (0, 0, X, Y / 2)
center = Region (0, Y / 4, X, Y / 2)
lower = Region (0, Y / 2, X, Y / 2)
left = Region (0, 0, X / 2, Y)
right = Region (X / 2, 0, X / 2, Y)
-- 1/4
upperLeft = Region (0, 0, X / 2, Y / 2)
upperRight = Region (X / 2, 0, X / 2, Y / 2)
lowerLeft = Region (X / 2, Y / 2, X / 2, Y / 2)
lowerRight = Region (0, Y / 2, X / 2, Y / 2)
upperUpper = Region (0, 0, X, Y / 4)
upperLower = Region (0, Y / 4, X, Y / 4)
lowerUpper = Region (0, Y / 2, X, Y / 4)
lowerLower = Region (0, 3 * Y / 4, X, Y / 4)
leftLeft = Region (0, 0, X / 4, Y)
leftRight = Region (X / 4, 0, X / 4, Y)
rightLeft = Region (X / 2, 0, X / 4, Y)
rightRight = Region (3 * X / 4, 0, X / 4, Y)
-- 1/8
upperUpperLeft = Region (0, 0, X / 2, Y / 4)
upperUpperRight = Region (X / 2, 0, X / 2, Y / 4)
upperLowerLeft = Region (0, Y / 4, X / 2, Y / 4)
upperLowerRight = Region (X / 2, Y / 4, X / 2, Y / 4)
lowerUpperLeft = Region (0, Y / 2, X / 2, Y / 4)
lowerUpperRight = Region (X / 2, Y / 2, X / 2, Y / 4)
lowerLowerLeft = Region (0, 3 * Y / 4, X / 2, Y / 4)
lowerLowerRight = Region (X / 2, 3 * Y / 4, X / 2, Y / 4)
--
-- LIMIT 420 950
--125 012
--145 034
--165 056
--
-- ========== Main var ===========
CLEAR = 0 -- Stage clear times
STEP = 1 -- Step now
STEP_TEMP = STEP
STEP_REPEAT = 0 -- Loop times
RECHECK = 4 -- Loop times to recheck step
FindPicNumber = 0 -- Count Quests
TIMER = Timer () -- Timer of loop
TIMER2 = Timer () -- Timer of step
TIMER_ITEM = Timer () -- Time to make ITEMs
WEAPON_PIC = Pattern ( "Weapon_Skin_Shell.png") -- to name Kaji props pictures
ABILITY_PIC = Pattern ( "Ability_Detecte.png") -- the ability to make the image name
ITEM_PIC = Pattern ( "ITEM_Potion.png") -- to name image blending props
MAKE_STEP = 20
nextLocation = Location (0.45 * screenX, 0.845 * screenY) -- Use middle position between 1 and 2
--nextLocation1 = Location (0.5 * screenX, 0.83 * screenY)
--nextLocation2 = Location (0.416 * screenX, 0.854 * screenY)
noFriendLocation = Location (screenX-10, screenY-20)
friendLocation = Location (0.98 * screenX, 0.91 * screenY)
abilityLocation = Location (screenX, 0.90 * screenY)
Location_1 = Location (0.39 * screenX, 0.65 * screenY) Location_2 = Location (0.88 * screenX, 0.65 * screenY)
Location_3 = Location (0.39 * screenX, 0.755 * screenY) Location_4 = Location (0.88 * screenX, 0.755 * screenY)
Location_5 = Location (0.39 * screenX, 0.86 * screenY) Location_6 = Location (0.88 * screenX, 0.86 * screenY)
-- User Input Error Check (> 1)
if (QUEST <1) then QUEST = 1 end
if (ATTACKER <1 or ATTACKER> 6) then ATTACKER = 6 end
if (CLEAR_LIMIT <1) then CLEAR_LIMIT = 1 end
if (MAKE_ROUND <1) then MAKE_ROUND = 1 end
WAIT_TIME = WAIT_TIME * 60
-- =========== Main function set ============
function stepCheck ()
if (rightRight: exists ( "BattleStage.png", 0)) then if (DEBUG == true) then print ( "Pic 01") end return 1
elseif (lowerUpperLeft: exists ( "No_Buy.png", 0)) then if (DEBUG == true) then print ( "Pic 02") end return 1
elseif (upperUpper: exists ( "Mission_Clear.png", 0)) then if (DEBUG == true) then print ( "Pic 13") end return 7 -- 2016/04/25 New
elseif (upper: exists ( "Mission_Check.png", 0)) then if (DEBUG == true) then print ( "Pic 03") end return 10 -- 2016/04/25 New
elseif (upperLowerRight: exists ( "Select_Friend.png", 0)) then if (DEBUG == true) then print ( "Pic 04") end return 2
elseif (lowerLower: exists ( "GO.png", 0)) then if (DEBUG == true) then print ( "Pic 05") end return 3
elseif (lowerLowerLeft: exists ( "AUTO.png", 0)) then if (DEBUG == true) then print ( "Pic 06") end return 4
elseif (center: exists ( "OK2-status.png", 0)) then if (DEBUG == true) then print ( "Pic 07") end return 5 -- Get Exp Check OK
elseif (center: exists ( "Friend_OK.png", 0)) then if (DEBUG == true) then print ( "Pic 08") end return 9 -- Make Friend Check OK
elseif (upperUpper: exists ( "NEXT2-status.png", 0)) then if (DEBUG == true) then print ( "Pic 09") end return 8 -- Get Item Check OK
elseif (lowerUpper: exists ( "OK1.png", 0)) then if (DEBUG == true) then print ( "Pic 10") end return 4
elseif (lowerLower: exists ( "NEXT1.png", 0)) then if (DEBUG == true) then print ( "Pic 11") end return 5
elseif (upperUpper: exists ( "Unit_EXP.png", 0)) then if (DEBUG == true) then print ( "Pic 12") end return 6
elseif (lowerUpperLeft: exists ( "Not_Make_Friend.png", 0)) then if (DEBUG == true) then print ( "Pic 14") end return 9
else if (DEBUG == true) then print ( "Pic 00") print ( "Connecting Error ...") end return 1 -- Unknow (Network Error)
end
end
switch = {
[1] = function ()
-- User Input> Quests, Quest = MAX of Quests
FindPicNumber = table.getn (regionFindAllNoFindException (rightRight, "BattleStage.png"))
if (FindPicNumber> 0 and FindPicNumber <QUEST) then
QUEST = FindPicNumber
--toast ( "Reset Quest:" ..QUEST)
end
for i, m in ipairs (listToTable (rightRight: findAllNoFindException ( "BattleStage.png"))) do
if (i <QUEST) then
--toast ( "Skip Stage:" .. i)
elseif (i == QUEST) then
toast ( "Select Stage:" .. i)
click (m)
if (BUY == true and BUY_LOOP> 0) then
STEP = 10
if (lowerUpperRight: exists ( "BUY.png", 1)) then
lowerUpperRight: click ( "BUY.png")
BUY_LOOP = BUY_LOOP - 1
end
break
elseif (exists ( "No_Buy.png", 0)) then
click ( "No_Buy.png")
print ( "wait" ..WAIT_TIME .. "sec ....")
wait (WAIT_TIME)
else
STEP = 10
break
end
else
STEP = stepCheck ()
print ( "Step Check 1:" ..STEP)
toast ( "Step Check 1:" ..STEP)
break
end
end
end, -- Choose Quest
[10] = function ()
if (lowerLower: exists ( "NEXT3.png", 0)) then
lowerLower: click ( "NEXT3.png")
STEP = 2
end
end, -- Mission Check (2016/04/25 New)
[2] = function ()
if (upperLowerRight: exists ( "Select_Friend.png", 0)) then -- First
upperLowerRight: click ( "Select_Friend.png")
STEP = 3
elseif (FRIEND == true and FRIEND_LOOP> 0) then -- Last
--continueClick (friendLocation, 3)
click (friendLocation)
STEP = 3
if (DEBUG == true) then
print ( "friendLocation" ..FRIEND_LOOP .. ":" .. friendLocation: getX () .. "×" .. friendLocation: getY ())
end
end
end, -- Choose Friend
[3] = function ()
if (lowerLower: exists ( "GO.png", 5)) then
lowerLower: click ( "GO.png")
STEP = 4
end
end, -- Team Check
[4] = function ()
if (lowerLowerLeft: exists ( "AUTO.png", 5)) then
local AUTO_BUTTON = find ( "AUTO.png")
local AUTO_POS = Location (AUTO_BUTTON: getX (), AUTO_BUTTON: getY ())
if (AUTO_BATTLE == true) then
lowerLowerLeft: click (AUTO_POS)
while (true) do
if not (lowerLowerLeft: exists ( "AUTO.png", 0)) then
if (lowerUpper: exists ( "OK1.png", 0)) then -- Network Connecting Error
lowerUpper: click ( "OK1.png")
else
STEP = 5
break
end
end
end
else
local LIMIT = listToTable (lower: findAllNoFindException ( "Limit.png"))
local OFFSET = 200
local ITEM_COUNT = 10
while (true) do
for i, m in ipairs (LIMIT) do
--print (LIMIT [i]) -- Get Position
if (USE_SUMMON == true and i == 1) then
dropToS = Location (m: getX () + OFFSET, m: getY ()) -- to the right slide
dragDrop (m, dropToS) -- Use Summon (→)
-- ★ to add a line to determine whether you can use summon
click (Location_2) -- Select Summon
elseif( USE_ITEM == true and ITEM_COUNT >= 1 ) then
dropToI = Location (m: getX () - OFFSET, m: getY ()) -- Left slide
dragDrop (m, dropToI) -- Use Item (←)
click (Location_2) -- Item Select
click (m) -- Target Select
ITEM_COUNT = ITEM_COUNT -1
toast ( "ITEM Count =" .. ITEM_COUNT)
elseif (USE_ABILITY == true) then
dropToA = Location (m: getX () + OFFSET, m: getY ()) -- to the right slide
dragDrop (m, dropToA) -- Use Ability (→)
wait (1)
dragDrop (Location_6, Location_2)
--click (abilityLocation)
click (Location_4) --
-- ★ ability to position difficult to locate -__-
else
end
--click (m)
if( i >= ATTACKER) then
click (AUTO_POS)
click (AUTO_POS)
wait (3)
break
end
end
if not (lowerLowerLeft: exists ( "AUTO.png", 0)) then
STEP = 5
break
end
end
end
else
lowerUpper: existsClick ( "OK1.png", 0) -- Network Connecting Error
end
end, -- (Network Connecting) Battles
[5] = function ()
if( FAST_MODE == true ) then
if (upperLower: exists ( "Result.png", 7)) then
--toast ( "Result 1")
if (CONTINUE_CLICK == true) then
continueClick (nextLocation, 40) -- ★ Continue Click OFF
else
for i = 1, CLICK_TIMES do click (nextLocation) end
end
STEP = 9
if (upperLower: exists ( "Result.png", 0)) then
if (lowerLower: exists ( "NEXT1.png", 0)) then
lowerLower: click ( "NEXT1.png")
STEP = 6
end
end
if (DEBUG == true) then
print ( "nextLocation:" .. nextLocation: getX () .. "×" .. nextLocation: getY ())
end
elseif (lowerUpper: exists ( "OK1.png", 0)) then -- Network Connecting Error
lowerUpper: click ( "OK1.png")
end
elseif (lowerLower: exists ( "NEXT1.png", 3)) then -- to be revised
--local NEXT = find("NEXT1.png")
--local SKIP = Location (NEXT: getX (), NEXT: getY ())
--if (FindPicNumber <4) then
--toast ( "Result 2")
-- ContinueClick (SKIP, 20)
-- STEP = 7
--else
--toast ( "Result 3")
lowerLower: click ( "NEXT1.png")
STEP = 6
--end
else
-- Network Connecting Error
center: existsClick ( "OK2.png", 0)
end
end, -- (Network Connecting) Get Gil & Unit Exp & Rank Exp Check
[6] = function ()
if (upperUpper: exists ( "Unit_EXP.png", 0)) then
upperUpper: click ( "Unit_EXP.png")
STEP = 7
end
end, -- Get Unit Exp & Trust Exp & Limit Exp Check
[7] = function ()
if (lowerLower: exists ( "NEXT2.png", 0)) then
local home = find ( "NEXT2.png")
if (DEBUG == true) then
print ( "SKIP POS:" .. home: getX () .. "✕" .. home: getY ())
end
if (CONTINUE_CLICK == true) then
lowerLower: continueClick ( "NEXT2.png", 8) -- ★ Continue Click OFF
else
for i = 1,2 do click (nextLocation) end
end
STEP = 8
end
end, -- Clear Mission Check
[8] = function ()
if (lowerLower: exists ( "NEXT2.png", 0)) then
if (CONTINUE_CLICK == true) then
lowerLower: continueClick ( "NEXT2.png", 3) -- ★ Continue Click OFF
else
for i = 1,1 do click (nextLocation) end
end
STEP = 9
end
end, -- Get Item Check
[9] = function ()
if (FRIEND == true and FRIEND_LOOP> 0) then
lower: existsClick ( "Make_Friend.png", 0)
if (lower: exists ( "OK1.png", 5)) then
lower: click ( "OK1.png")
FRIEND_LOOP = FRIEND_LOOP -1
end
else
lower: existsClick ( "Not_Make_Friend.png", 0)
end
STEP = 1
CLEAR = CLEAR + 1
STEP_REPEAT = 0
print ( "◆ Clear:" ..CLEAR .. "times (" ..TIMER: check () .. ")")
toast ( "Clear:" ..CLEAR .. "times (" ..TIMER: check () .. ")")
TIMER: set ()
end -- (Network Connecting) Make New Friend Check
}
-- =========== Make function set ============
function makeStepCheck ()
if (upper: exists ( "Weapon_Main.png", 3)) then return 20
elseif (upper: exists ( "Ability_Main.png", 0)) then return 21
elseif (upper: exists ( "ITEM_Main.png", 0)) then return 22
else return 29
end
end
makeSwitch = {
[20] = function ()
if (WEAPON_ON == true) then makeRound ( "Weapon_Main.png", WEAPON_PIC, "Ability_Small.png")
else upper: existsClick ( "Ability_Small.png", 0)
end
end,
[21] = function ()
if (ABILITY_ON == true) then makeRound ( "Ability_Main.png", ABILITY_PIC, "ITEM_Small.png")
else upper: existsClick ( "ITEM_Small.png", 0)
end
end,
[22] = function ()
if (ITEM_ON == true) then makeRound ( "ITEM_Main.png", ITEM_PIC, "Make_Return.png")
else upper: existsClick ( "Make_Return.png", 0)
end
end,
[29] = function ()
upper: existsClick ( "Make_Return.png", 0)
end
}
function makeRound (img_main, target_pos, img_next)
if (upperUpper: exists (img_main)) then
-- Get Complete Item
for i, m in ipairs (listToTable (rightRight: findAllNoFindException ( "Complete_Big.png"))) do
click (m)
lowerUpper: existsClick ( "Complete_OK.png", 3)
lowerUpper: existsClick ( "Complete_OK.png", 0) -- Chain pyroxene crystals
end
-- Make New Item
for i, m in ipairs (listToTable (rightRight: findAllNoFindException ( "Blank.png"))) do
click (m)
if (left: exists (target_pos, 3)) then
click (target_pos)
if (lower: exists ( "Make_Check.png", 3)) then
click ( "Make_Check.png")
if (lowerUpper: exists ( "Make_Check_YES.png", 3)) then
click ( "Make_Check_YES.png")
wait (2)
end
end
end
end
upper: existsClick (img_next, 3)
else
return
end
end
function itemMake ()
if (upperLeft: exists ( "Complete_Small.png", 7)) then
click ( "Complete_Small.png")
elseif (upperLeft: exists ( "Blank_Small.png", 3)) then
click ( "Blank_Small.png")
else
return
end
MAKE_STEP = 20
while (true) do
if (DEBUG == true) then
print ( "MAKE_STEP:" .. MAKE_STEP)
toast ( "MAKE_STEP:" .. MAKE_STEP)
end
if (MAKE_STEP == 29) then
break
else
if (DEBUG == true) then
print ( "Make step checking ...")
toast ( "Make step checking ...")
end
MAKE_STEP = makeStepCheck ()
makeSwitch [MAKE_STEP] ()
end
end
end
-- ========== Main program ===========
repeat
STEP_TEMP = STEP
if (DEBUG == true) then -- Debug Mode Setting
print ( "step:" ..STEP .. ", loop:" ..STEP_REPEAT .. ", timer:" ..TIMER2: check ())
TIMER2: set ()
end
if (STEP == 1 and ITEM_MAKE == true) then -- Make item check timer> 300 sec
--if (TIMER_ITEM: check ()> 300) then
if (CLEAR% MAKE_ROUND == 0) then
toast ( "Item timer:" .. TIMER_ITEM: check ())
print ( "Item timer:" .. TIMER_ITEM: check ())
if (upperRight: exists ( "Home_Small.png", 8)) then
click ( "Home_Small.png")
itemMake ()
lower: existsClick ( "World_Big.png", 5)
existsClick ( "MAP_Earth_Temple.png", 5)
end
TIMER_ITEM: set ()
end
end
switch[STEP]() -- Next step check
if (STEP_TEMP == STEP) then -- Step repeat check
STEP_REPEAT = STEP_REPEAT + 1
else
STEP_REPEAT = 0
end
if (STEP_REPEAT> RECHECK) then -- Recheck Step now
STEP = stepCheck ()
STEP_REPEAT = 0
print ( "Step Check 2:" ..STEP)
toast ( "Step Check 2:" ..STEP)
end
until CLEAR == CLEAR_LIMIT
|
|
Kako
Contributors
Posts: 105
|
Post by Kako on Jul 19, 2016 9:38:29 GMT
This is what I have so far. Google translate did shift some of the code around, so its not a pretty as the original (it may have broke some of the code also?). Now all I need to do is re-do all the images. ... It seems to me that putting code through Google Translate is quite risky (only one character needs to chance to cause a bug in the code, but it is worth a try) If the code crashes while the images are replaced correctly, you could try to go over all the addTextView, addCheckBox dialogShow, toast and print functions in the original file and replace the texts one by one. I understand this sounds tedious and you'll still have to be careful: don't change variable names, or change 'm so they match again, otherwise you'll still break the code (keep in mind Lua is case sensitive).
|
|
|
Post by jakethesnake on Jul 20, 2016 19:31:23 GMT
It seems to me that putting code through Google Translate is quite risky (only one character needs to chance to cause a bug in the code, but it is worth a try) If the code crashes while the images are replaced correctly, you could try to go over all the addTextView, addCheckBox dialogShow, toast and print functions in the original file and replace the texts one by one. I understand this sounds tedious and you'll still have to be careful: don't change variable names, or change 'm so they match again, otherwise you'll still break the code (keep in mind Lua is case sensitive). Great advice! I did run it without updating the pictures and fixed some errors that google rearranged. I'm thinking of starting a new thread because I started a new script to just get the hang of lua. Its very, very primitive FFBE script that works some of the time. I will share it soon, but I would like some feedback on what I can do to make it "smarter" and more "friendly" to all devices. For now I'm going to install the jp version of ffbe to learn how AZ's script works. Then I will translate the pictures over and share here.
|
|