Scripting still screwed up #123


  • New
  • Defect
Open
Assigned to ivanfromitaly
  • _ForgeUser18416192 created this issue May 19, 2016

    Once again, I cannot find out how to do this and I still beleive scripting is messed up! I am trying to make it say "You are not Ivanpro" everytime unless the first arugment is "Ivanpro" and if the first argument is "Ivanpro" it will say "You are not 16 buddy" unless your second argument is "16"

    My script that does not work:

    'MyName':
       command: /MyName
       type: RUN_CONSOLE
       runcmd:
       - "$Script$%Variable%Name=$arg1"
       - "$Script$%Variable%Age=$arg2"
       - "$Script$%if%Name==Ivanpro"
       - "$text$&bWelcome, you are Ivanpro!"
       - "$Script$%if%Age==16"
       - "$text$&cYou are also 16 and your name is Ivanpro"
       - "$Script$%elseif%Age!=16"
       - "$text$You are not 16 buddy"
       - "$Script$%else%"
       - "$Script$%if%Name!=Ivanpro"
       - "$text$&3You are not Ivanpro"

  • _ForgeUser18416192 added the tags Defect New May 19, 2016
  • ivanfromitaly posted a comment May 20, 2016

    InGame works all as intended, the console seems to have problem with the variable line. Anyway you can use that in this way : (The console still have some issues, or better, the script code of the console it's different and make it works in a different way. I see to resolve that in future).

    'MyName':
       command: /MyName
       type: RUN_CONSOLE
       runcmd:
       - "$Script$%if%$arg1==Ivanpro"
       - "$text$&bWelcome, you are Ivanpro!"
       - "$Script$%if%$arg2==16<and>$arg1==Ivanpro"
       - "$text$&cYou are also 16 and your name is Ivanpro"
       - "$Script$%else%"
       - "$Script$%if%$arg1!=Ivanpro"
       - "$text$&3You are not Ivanpro"
       - "$Script$%if%$arg2!=16"
       - "$text$You are not 16 buddy"
    
    • Already fixed the executing of "post" %else% things in console, if some if's are true before him. Now, i check for the variable and see what's the problem. -> Variables and PlayerData lines currently are executed in console only if they are in an if condition with a true result.

    Edited May 20, 2016
  • _ForgeUser19598597 posted a comment Jun 29, 2016

    I have some confusion about scripts - here you show them in " " and in the documentation sometimes they're in ' ' and sometimes none at all. What are the cases for this?

    Also, the HasPermission or it could be that == and != are not functioning as intended as they seem to be working the opposite of their intention.

    For example, i am working on a command that looks for a permission mycmd.player and if it == (equals) true, then /dosomething And it won't do anything. But if I set it to != it will.

    Secondly, i'm not sure about the stability of the latest version of the plugin - a week ago I implimented a permissions check to allow flight or disallow flight and it has worked fine until this morning now it's "speaking" the script instead of using it. http://prnt.sc/bmk6z2

  • _ForgeUser19598597 posted a comment Jun 29, 2016

    I see the errors I had in that script (should have been $Script$$HasPermission==some.permission)

    But still a little confused about " " and ' ' no, wait thats text script and " " includes colors and ' ' does not...

  • ivanfromitaly posted a comment Jun 29, 2016

    @VoigtmanMC: Go

    Using "" or '' prevent yml errors, nothing more.

    Anyway, the correct syntax is "$Script$%if%HasPermission=node.node", just "=". There isn't any != or other condition with HasPermission.


    Edited Jun 29, 2016

To post a comment, please login or register a new account.