GamerzPlanet - For All Your Online Gaming Needs!!  

Go Back   GamerzPlanet - For All Your Online Gaming Needs!! > Online Gaming > FlyFF Discussion



Refresher Function

FlyFF Discussion


Reply
 
Thread Tools Display Modes
Old 06-22-2008, 09:50 AM   #1
Registered User
 
Last Online: 08-20-2008 11:52 AM
Join Date: Jun 2008
Posts: 12
Thanks: 1
Thanked 0 Times in 0 Posts
Nini is on a distinguished road
iTrader: 0 / 0%
Points: 2,082.55
Bank: 0.00
Total Points: 2,082.55
Refresher Function

Ok. I am making a function that will use an MP potion whenever the player's MP gets below a certain percent. I think I almost have it, but when I run it with the code below, I get the error
"[10:12:33] Scripting: Execution of script file Scripts\wtfux.atmt failed: [Automaton::Bindings::System::AddCommand] incorrect arguments".
Could someone please tell me my error? Thanks.

In OnTick event:
Code:
    if(wtfuxv.mana == 1) then
          if("..Actor:Get(ManaPoints)" <= "..Actor:Get(ManaPointsMax)" * wtfuxv.manapercent) then
            ExecuteCommand(Item FirstRefresher)
            ExecuteCommand(Item SecondRefresher)
            ExecuteCommand(Item ThirdRefresher)
            ExecuteCommand(Item FourthRefresher)
            ExecuteCommand(Item FifthRefresher)
          end
        end
The functions:
Code:
function wtfux.enautomana( Arguments )
  wtfuxv.mana = 1
  wtfuxv.manapercent = tonumber( "..Arguments.." ) * 0.1
  return true
end

function wtfux.disautomana()
  wtfux.Mana = 0
  return true
end
The commands:
Code:
AddCommand ( wtfux.enautopotion, "EnAutoPotion", "[MP]", "Uses a mana potion when your MP is below [MP] percent." )
AddCommand ( wtfux.disautopotion, "DisAutoPotion", "", "Disables using the AutoPotion command." )
Nini is offline   Reply With Quote
Sponsored Links
Old 06-22-2008, 10:05 AM   #2
Registered User
 
Last Online: 08-31-2008 03:33 AM
Join Date: Dec 2007
Age: 18
Posts: 32
Thanks: 4
Thanked 11 Times in 4 Posts
pyro12345 is an unknown quantity at this point
iTrader: 0 / 0%
Points: 7,180.05
Bank: 0.00
Total Points: 7,180.05
Re: Refresher Function

I cant tell you what the error is but i can tell you this

When you run Automaton and press END you will open a menu in wich you can set the MP, FP and HP recovery using refreshers, vital drinks and food.

Its great that your learning LUA ^^
pyro12345 is offline   Reply With Quote
Old 06-22-2008, 02:28 PM   #3
Registered User
 
Last Online: Yesterday 08:32 PM
Join Date: Feb 2007
Age: 18
Posts: 412
Thanks: 26
Thanked 77 Times in 30 Posts
M0J0 is on a distinguished road
iTrader: 2 / 100%
Points: 3,948.77
Bank: 14,664.46
Total Points: 18,613.23
Re: Refresher Function

No clue but just from looking at it I see a few spelling mistakes that may not be intended.

wtfuxv vs wtfux
wtfuxv.mana vs wtfux.Mana (capital and alternate spelling)
wtfux.enautopotion vs wtfux.enautomana (different functions entirely)

check that and try it.

ex: Try changing the addcommands to this:

Code:
AddCommand ( wtfux.enautomana, "EnAutoPotion", "[MP]", "Uses a mana potion when your MP is below [MP] percent." )
AddCommand ( wtfux.disautomana, "DisAutoPotion", "", "Disables using the AutoPotion command." )

Last edited by M0J0; 06-22-2008 at 02:31 PM.
M0J0 is offline   Reply With Quote
Old 06-22-2008, 02:48 PM   #4
Registered User
 
Last Online: 08-20-2008 11:52 AM
Join Date: Jun 2008
Posts: 12
Thanks: 1
Thanked 0 Times in 0 Posts
Nini is on a distinguished road
iTrader: 0 / 0%
Points: 2,082.55
Bank: 0.00
Total Points: 2,082.55
Re: Refresher Function

Quote:
wtfuxv vs wtfux
wtfuxv.mana vs wtfux.Mana (capital and alternate spelling)
I think wtfuxv actually means wtfux global variable, at least I'm pretty sure because if you look at the top of wtfux's script it has wtfuxv.(whatever variable).

The wtfuxv.mana vs wtfux.Mana.
As i said before it is supposed to be wtfuxv and the it's supposed to be uncapitalized. If you look at the other variables they are not capitalized. Plus it does not really matter, as long as I always use the variable without a capital.

Quote:
wtfux.enautopotion vs wtfux.enautomana (different functions entirely)
Lol... yeah. Woops.

It's supposed to be wtfux.enautomana and wtfux.disautomana.
Lol.
Thanks for your help.

There is one more thing though.
I'm pretty sure that the "ExecuteCommand( Item FristRefresher) doesn't work, so I'm going to try using the UseItem command. the only problem is that I do not know the IDs for First Refresher - Fifth Refresher. Could someone please find them for me? Thanks

EDIT:
Ok, I've fixed my script and I do not need the Refresher's IDs. Ive got the script so that it runs, but when I use my command, it
gives me this error:
"Error: Call to command in script failed: [string "..."]:736: attemt to perform arithmetic on a nil value."
The line that it is talking about is this line:
"wtfuxv.manapercent = tonumber( "..Arguments.." ) * 0.1"
Thanks.

Last edited by Nini; 06-22-2008 at 05:22 PM.
Nini is offline   Reply With Quote
Old 06-22-2008, 08:56 PM   #5
Registered User
 
Last Online: Yesterday 07:41 AM
Join Date: Mar 2008
Posts: 15
Thanks: 3
Thanked 1 Time in 1 Post
ruidz is on a distinguished road
iTrader: 0 / 0%
Points: 6,898.24
Bank: 0.00
Total Points: 6,898.24
Re: Refresher Function

Maybe instead of:
if(wtfuxv.mana == 1) then
it should be
if(wtfux.mana == 1) then
Idk...?
ruidz is offline   Reply With Quote
Old 06-23-2008, 04:21 PM   #6
Registered User
 
Last Online: Yesterday 08:32 PM
Join Date: Feb 2007
Age: 18
Posts: 412
Thanks: 26
Thanked 77 Times in 30 Posts
M0J0 is on a distinguished road
iTrader: 2 / 100%
Points: 3,948.77
Bank: 14,664.46
Total Points: 18,613.23
Re: Refresher Function

Yea, as I sort of hinted I have no experience with Lua or scripting for Automaton, I was strictly looking at the code. I have a knack for finding logic errors =P

Quote:
wtfuxv.manapercent = tonumber( "..Arguments.." ) * 0.1
Did you copy/paste this from somewhere? Again, no idea, but if it says "..Arguments.." I'm guessing you are supposed to put something in here, possibly the mana points of the char?

Why don't you just custom enter the mana until you get it working, don't try to work with crazy percent things just yet.

Try changing this:
Code:
if("..Actor:Get(ManaPoints)" <= "..Actor:Get(ManaPointsMax)" * wtfuxv.manapercent) then
To something similar to this:
Code:
if("..Actor:Get(ManaPoints)" <= 500 then
500 is just an example, put whatever you ammount you want....If I got it right, it should do something when your mana is less than or equal to 500.

But then again, I probably shouldn't be going into this lol, I don't do anything with lua or Automaton.
M0J0 is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

All times are GMT -7. The time now is 02:13 AM.


Powered by: vBulletin
Copyright ©2008, GamerzPlanet.Net
SEO by vBSEO 3.2.0 RC5 ©2008, Crawlability, Inc.
Network: GamerzPlanet | ForumzPlanet | GzPUpload | GzPArcade | GzP Host | Poker Tips | Visits: