Jump to content

function error


Cornysz
 Share

Recommended Posts

So i put function code liek this in upper line

 

function searchauto(search)

gg.searchNumber(search, gg.TYPE_AUTO, false, gg.SIGN_EQUAL, 0, -1)

end

 

and then i use the function (this is just for example)

::code::

searchauto('183W;183W;125F')

blabla

 

after i execute my script i got an error attempt to call nil, i don't understand. How to fix this? Ty in advance

Link to comment
Share on other sites

place function in first then call in last
function searchauto(search)gg.searchNumber(search, gg.TYPE_AUTO, false, gg.SIGN_EQUAL, 0, -1)endsearchauto('183W;183W;125F')

 

already bro. i place the function in upper line and i call in below it.
but still error :/
Link to comment
Share on other sites

Place first run or call first run in last script
 

function code()
 searchauto('183W;183W;125F')
end

-- i want this is run first
function menu()
  blablabla....
  code()
end

function searchauto(search)
 gg.searchNumber(search, gg.TYPE_AUTO, false, gg.SIGN_EQUAL, 0, -1)
end

--place first run or call first run in last script
menu()

 

Link to comment
Share on other sites

Place first run or call first run in last script
 
function code()searchauto('183W;183W;125F')end-- i want this is run firstfunction menu() blablabla.... code()endfunction searchauto(search)gg.searchNumber(search, gg.TYPE_AUTO, false, gg.SIGN_EQUAL, 0, -1)end--place first run or call first run in last scriptmenu()

 

"Place first run or call first run in last script" what do u mean? im not understand hehe srry :/
Link to comment
Share on other sites

function searchauto(search)
gg.searchNumber(search, gg.TYPE_AUTO, false, gg.SIGN_EQUAL, 0, -1)
end

::pkat::
do
gg.toast('Please wait. Loading!')
searchauto('98W;98W;125F')
local a=gg.getResults(4)
freeze(a,'5480',2)
freeze(a,'5480',3)
freeze(a,'5480',4)
aa = gg.alert('blabla','OK')
goto smth
end

i only copy the code related to searchauto function

Link to comment
Share on other sites

1 hour ago, Cornysz said:

function searchauto(search)
gg.searchNumber(search, gg.TYPE_AUTO, false, gg.SIGN_EQUAL, 0, -1)
end

::pkat::
do
gg.toast('Please wait. Loading!')
searchauto('98W;98W;125F')
local a=gg.getResults(4)
freeze(a,'5480',2)
freeze(a,'5480',3)
freeze(a,'5480',4)
aa = gg.alert('blabla','OK')
goto smth
end

i only copy the code related to searchauto function

::pkat::
do
gg.toast('Please wait. Loading!')
searchauto('98W;98W;125F')
local a=gg.getResults(4)
if gg.getResultCount() > 0 then
  freeze(a,'5480',2)
  freeze(a,'5480',3)
  freeze(a,'5480',4)
  aa = gg.alert('blabla','OK')
end
goto smth
end

Add gg.getResultCount()

Edited by Revoxtical
Link to comment
Share on other sites

::pkat::dogg.toast('Please wait. Loading!')searchauto('98W;98W;125F')local a=gg.getResults(4)if gg.getResultCount() > 0 then freeze(a,'5480',2) freeze(a,'5480',3) freeze(a,'5480',4) aa = gg.alert('blabla','OK')endgoto smthend

Add gg.getResultCount()

i need to fix the searchnumber :/
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.