scripting

How to infinite loop numbers in while loops? (Unity3D- unityscript)

我的梦境 提交于 2019-12-13 05:44:03
问题 function OnMouseDown () { rotationNumber +=1; } function Update () { while (rotationNumber == 1) { gameObject.GetComponent(SpriteRenderer).sprite = leftArrow; return; } while (rotationNumber == 2) { gameObject.GetComponent(SpriteRenderer).sprite = upArrow; return; } while (rotationNumber == 3) { gameObject.GetComponent(SpriteRenderer).sprite = rightArrow; return; } while (rotationNumber == 4) { gameObject.GetComponent(SpriteRenderer).sprite = upArrow; rotationNumber = 1; return; } } I want to

Linux scripting: Passing parameters

有些话、适合烂在心里 提交于 2019-12-13 05:41:28
问题 I'm new to scripting and need a lot of help understanding how to load in a text file that will be passed in by a parameter. I'm afraid that you'll have to really dumb down your answers. Please explain like I am a 10 year old! For example, how does one write a script that accepts two parameters, a file path and an integer. Also how do you run the script? would you just call script.sh -f data.txt 回答1: Could you explain your requirement a bit in detail? I assume you are looking to extract the

How to download dynamic generated content from webpage?

让人想犯罪 __ 提交于 2019-12-13 05:41:25
问题 I'm trying to download some data from a webpage that is dynamically generated, so using wget doesn't work. The page is http://gaceta.diputados.gob.mx/SIL/Legislaturas/Listados.html I want to download the list shown for each of the options that can be selected in the field "Legislatura" once downloaded I can process the data in ruby. Just wanted to know what is the best way to download this, and if posible to select each of the options and download. 回答1: You can use the Web Inspector in Safari

Using rsync in expect script with find -ctime give me an error?

拥有回忆 提交于 2019-12-13 05:28:19
问题 I need some help with an expect script and rsync. When I run rsync in command line like this it works fine: rsync -avz root@10.33.122.22:'$(find /cluster/storage/nobackup/coremw/var/log/saflog/FaultManagementLog/alarm/ -ctime -1)' /home/imstest/shared/Generate/ReportingT3/tmp/ But when I use my expect script that looks like this I get an error: #!/usr/bin/expect -f set host_ip [lindex $argv 0 ] set user [lindex $argv 1 ] set password [lindex $argv 2] set scp_remote_directory [lindex $argv 3 ]

Indesign script - How to get first paragraph in threaded text frame

前提是你 提交于 2019-12-13 05:23:33
问题 I have a book with text frames on each page , they are all threaded together, I want to grab hold of each text frames first paragraph, is there any way, I'm trying app.activeDocument.textFrames[0].paragraphs.length and returns "0", only parentStory.paragraphs.length returns the paragraphs but I can't know which are the first in a text frame, any help? 回答1: You should be able to use the textContainers attribute of Story to get each TextFrame of a story. var frames = story.textContainers; //

Read multiple strings from a file as a different variables.

筅森魡賤 提交于 2019-12-13 05:18:04
问题 In continuation of How to read multiple strings in a file as a different variables :- file.conf: #### #xyz key name /usr/bin/ /text/abc/ value pswd Now I want write a script to having two variable like above script.sh key="name" #key as variable value="pswd" #value as variable /usr/bin/=/text/abc/ Please refer to above mentioned link for more info. 回答1: You have to have a way to ignore the lines with invalid entry for a valid unix variable name. A unix variable follows this rule: start with

icacls permissions script in powershell

这一生的挚爱 提交于 2019-12-13 05:06:26
问题 Let me start off by saying I am very new to scripting! Basically what I am trying to do is to write a script that will create all of these files: For the 13-14 in the files that is the previous and current year so I need a variable that when I run the script next year it will be 14-15. The top folders are AD,CC,DC,FS,IT,OP: For example C:\Test\AD\13-14\Audit\Fir C:\Test\CC\13-14\OSA C:\Test\DC\13-14\Vendor C:\Test\FS\13-14\Maintenance C:\Test\IT\13-14\Detail C:\Test\OP\13-14\Training (There

Temporary cloud storage and sending script

限于喜欢 提交于 2019-12-13 05:04:31
问题 I'm looking for a way to store small data packages on a temporary place on the cloud, to be lately sent from there and thus erased. It would be also wonderful to be able to create a cloud-script for the sending/erasing task. This is the scenario: data on the cloud will be sent to different places in different formats, so I need it to be up there until the destination is assigned. When this happens, that particular amount of data will be formatted to the particular destination structure and

Perl script to check remote server for process

跟風遠走 提交于 2019-12-13 04:47:44
问题 I am having a bit of a problem with a script that I setup. A little background: The function of the script is to read from a list of servers that is in a text file separated by :: , log on to the servers, check to see that mysql is running and report back. The file is configured such that each line has: Servername::Ip address::port number The problem I am having is that I think perl is trying to concatenate the ip address that I am feeding to the function I have in the code. Can anyone point

Remove character from file in-place with native Windows tools

折月煮酒 提交于 2019-12-13 04:46:26
问题 I'd like to remove the last character off a large file. The restrictions are that: the file has to be modified in-situ, without using the disk space required for a similar second file it's a windows machine I cannot copy any compiled code onto the machine so I cannot create a small c# program of c++ program to manipulate the file this also means any non-native scripting is not available, like python. As far as I know, this limits me to bat, VB (or JScript) but it does not look like there is a