Using minecrafts plugin Skript - How to make a loop, that checks, if player goes in WorldGuard region? - minecraft

So, I wanna make a loop, that checks, if player goes in WorldGuard region. I don't have any specific details, just i wanna know how to do it.
This is how my code looks like:
set {_rg::*} to %region at player%
loop {_rg::*}:
if "%loop-value%" contains "fail1_1"
execute console command "tp %player% -425.5 9.87500 2299.767 0.0 50.0"
if "%loop-value%" contains "fail1_2":
execute console command "tp %player% -425.5 10 2304.5 0.0 50.0"
Im not really an expert, but i tried to look it up. So, nothing really happened, there were no errors, but it didn't work as i expected (if you fall into region, you get teleported to a location)

I think it is most likely that your Skript installation is broken, your code should give multiple errors that make you aware why your code is not working. Try the latest version of Skript that is available on GitHub.
set {_rg::*} to %region at player%
If you are not working inside a text, you can't use the percentage signs, these are made to interpolate the given variable to text. Skript would create a working {_rg:*} list variable without the percentage signs.
You could use the percentage signs if you wanted to message at which regions the player is:
message "Regions: %region at player%" to player
if "%loop-value%" contains "fail1_1"
A colon is missing at the end of this statement, which should lead to errors while parsing.
execute console command "tp %player% -425.5 9.87500 2299.767 0.0 50.0"
While you can execute commands to teleport players using Skript, you can also teleport players without executing console commands. The reason for this is that Skript will not check if the command is going to work.
Instead, you can use the location function to create a new location and teleport the player to it.
teleport player to location(-425.5, 9.87500, 2299.767, player's world, 0.0, 50.0)

Related

<screen scraping in uipath> combine split numbers

I would like to screen scrape a few user details including the handphone no. from one application and paste the details into another application. There's a spacing in the handphone no. e.g. 8123 4567. I would like to remove the spacing and paste 81234567 into the other application.
I have use Build Data Table and Write Range to store the captured information in. In the handphone no. screen scrape activity, I did the following additional steps to split the numbers and combine them into 1. It works the first few times but when I tried running the script a few days later, it stopped working. Basically, the handphone no. is not completely copied over. Sometimes it returns as 8123 and sometimes as 812.
Assign
ArrayHandphoneNo = HandphoneNo.Split({" "},stringsplitoptions.None)
Assign
HandphoneNo = ArrayHandphoneNo(0)
Try Catch
HandphoneNo = HandphoneNo + ArrayHandphoneNo(1)
Catches exception
Assign
HandphoneNo = HandphoneNo
May I know what went wrong?
Why you having a workaround. From my perspective you simply need a line of code that is removing all spaces. So you get back the full digit number. So try with this:
myString = myString.Replace(" ", "")
in your assign activity.
Could look like this one:

Scripts connected to an Image in EggPlant

I have LoginButton.png that is being used across the whole suite in different scripts. I want to edit the name or move it to a new folder, without breaking all the scripts. So is there a way to list all the scripts that are using this image or to refactor the name/path across the whole suite?
Find option (Edit>Find) it's the closest to what I want, but it only looks at the open script, not the whole suite, and replaces anything with similar naming convention eg: Find "LoginButton" and replace with "NewButton", if you have "LoginButton", "LoginButton1", "LoginButton2" after the replace you will end up with "NewButton", "NewButton1", "NewButton2", and i just want to change "LoginButton" not "LoginButton1" and "LoginButton2".
Thanks
Unfortunately, you've found the closest solution. One of Eggplant's major drawbacks is that you're locked into a single, (rather feature-less) IDE. If you're having issues matching other words with your search query, you can try including spaces, i.e. " LoginButton ", on the outside of the word.

verifyText using *text* instead of verifyTextPresent (deprecated)

I'm kind of new to selenium IDE and automated test and I don't know much about programming languages. I have a question concerning verifyText command as verifyTextPresent is deprecated. If I put the target word/text in * * will it work as if I was using verifyTextPresent? Could waitForText work?
I am trying to verify that the search function of a website is working as expected. I search the word "client" and I want to verify that the word is present in the results.
clickAndWait css=div.cf-tooltip-text
type id=edit-global-search client
clickAndWait id=edit-submit-global-search
verifyText id=content-column *client*
This works, but in the Log I can not understand what it really does. Also if I try the word on its own "client" I get an error which I understand because it compares it to the text of the whole column. I also tried to put an irrelevant word between asterisks such as youwillnotfindthetext (just to make sure that everything between asterisks will pass the test) and there I had an error too.
So it seems to be working somehow but I want to ask some of you expert guys.
Thanks
If you put a * in starting and ending means it will look for the inner text containing in the specific element. If a text is present as you given in the script it will return a pass. If the text u specified in the script is not present, it will throw an error. That's what happens when you put youwillnotfindthetext in between the *.
Check this link Selenium: test if element contains some text

Making sqlite3 inserts using python variable

so I have a sqlite3 table with the following schema:
('number','name','prename','id','number_a','location_num','team')
Im wondering how to be able to fill some of those with content of a python variable.Number,id,number_a and team dont have to be filled.So basically, I have 3 python variable
thename='franco'
theprename='john'
thelocation_num=2
So I want to be able to insert at the right place the content of the python variable.I tried this so far:
cur.execute("INSERT INTO mytable('number','name','prename','id','number_a','location_num','team') VALUES('','?','?','','','?','')",(thename,),(theprename,),(thelocation_num,))
However it doesnt work.I dont know how to do that.
thank you
You can use
cur.execute("""INSERT INTO mytable
('number','name','prename','id','number_a','location_num','team')
VALUES('',?,?,'','',?,'')""",
(thename, theprename, thelocation_num))
If autocommit is not enabled, you also need to call connection.commit() in order to write the changes to disk.

PsychoPy Builder - How to I take a rest part way through a set of trials?

In PsychoPy builder, I have a lot of trials and I want to let the participant take a rest/break part way through and then press SPACE to continue when they're ready.
Any suggestions about how best to do this?
PsychoPy Builder uses the TrialHandler class and you can make use of its attributes to do control when you want to take a rest.
Assuming you're trial loop is utilising an Excel/csv file to get the trial data then make use of trialHandler's attribute : thisTrialN
e.g.
1/ Add a routine containing a text component into your loop (probably at the beginning) with your 'now take a rest...' message and a keyboard component to take the response when they are ready to continue.
2/ Add a custom code component as well and place something similar to this code into its "Begin Routine" tab:
if trials.thisTrialN not in [ int(trials.nTotal / 2) ]:
continueRoutine=False
where 'trials' is the 'name' of your trial loop.
The above will put a rest in the middle of the current set of trials but you could replace it with something like this
if trials.thisTrialN not in [10,20]:
continueRoutine=False
if you wanted to stop after 10 and again after 20 trials.
Note, if you're NOT using an Excel file but are simply using the 'repeat' feature of a simple trial loop, then you'll need to replace thisTrialN with thisRepN
If you're using an Excel file AND reps you'll need to factor in both when working out when you want to rest.
This works by using one of Builder's own variables - continueRoutine and sets it false for most trials so that most of the time it doesn't display the 'take a rest' message.
If you want to understand more, then use the 'compile script' button (or F5) and take a look at the python code that Builder generates for you.