Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The block "create text with" from blockly add \ in front of percentage sign #649

Open
oben01 opened this issue Dec 20, 2019 · 0 comments
Open
Assignees

Comments

@oben01
Copy link
Member

oben01 commented Dec 20, 2019

The block "create text with" from blockly add \ in front of percentage sign.

I am using Python 2.7, this is a sample of my script :

sample_script

It is converted in python as :

# yMain is the script entry point, called by Yadoms
#Imports helpers
import scriptUtilities
import time


def yMain(yApi):
   print ('Script started')
   while True:
      # Wait for event block -------> START
      endOfLoop = False
      wantToBreak = False
      wantToContinue = False
      while endOfLoop != True :
         totalKeywordsToListen = [19]
         waitForEventResult = yApi.waitForEvent(totalKeywordsToListen, False)
         keywordId = waitForEventResult.getKeywordId()
         outVar = waitForEventResult.getValue()
         if waitForEventResult.getType() == scriptUtilities.WAITFOREVENT_KEYWORD and keywordId == 19 and float(outVar) >= 20:
            yApi.writeKeyword(14, str(str(waitForEventResult.getValue()) + str('\%')))
            endOfLoop = True
   
      # Manage break/continue inside waitForEvents
      if wantToBreak:
         break
      if wantToContinue:
         continue
      # Wait for event block -------> END
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants