Create a free account to remove all ad content.

Author Topic:  [How to] Make Scripts  (Read 27974 times)

0 Members and 1 Guest are viewing this topic.

muD

  • Legendary Member
  • *
  • Posts: 1177
    • View Profile
Re: Scripts -[How to]-
« Reply #20 on: April 09, 2014, 01:25:37 AM »
hey muD, you should add a section for the wireless transmitter and receiver blocks.
could help alot for some of those inventive people!
and maybe add something about component pasting!
Yup, will get to them
______

section for Delays & Notifications added to OP

Powerlord

  • Jr. Member
  • *
  • Posts: 20
  • fafa
    • View Profile
Re: Scripts -[How to]-
« Reply #21 on: April 09, 2014, 01:32:00 AM »
Interesting guide, should help newcomers a lot.
agagag

The Gold Knight

  • Legendary Member
  • *
  • Posts: 1092
  • My Forgeplex is better ;)
    • View Profile
    • Insert Clickbait Title Here!
  • Other: 何
Re: Scripts -[How to]-
« Reply #22 on: April 09, 2014, 02:16:39 AM »
Question: In the notify script, what does the local/global part of the script do?

muD

  • Legendary Member
  • *
  • Posts: 1177
    • View Profile
Re: Scripts -[How to]-
« Reply #23 on: April 09, 2014, 02:37:28 AM »
Question: In the notify script, what does the local/global part of the script do?
I don't know.
I presume Local limits the notifications to within a certain distance of either the script block or admin running it.. & Global will notify everyone in the world but that is guesswork.
i tried testing in local split-screen but notifications pop up regardless of distance, which was expected..
Required 2 people on separate machines to find the distance a local notification was sent, if that is what it is..
i also want to find out

Jaz

  • Supreme Member
  • *
  • Posts: 3026
  • - Jaz
    • View Profile
    • The Useless Web
  • Xbox: Jaz the MAN 2
  • PSN: Jaz_the_MAN_2
  • Steam: Jaz the MAN 2
Re: -=[How to]=- Make Scripts
« Reply #24 on: April 09, 2014, 03:38:24 AM »
Once again, great topic. Thanks for writing it up. Well deserving of a sticky
i agree with Bob, this is one of my favourite topics if not it is my fav :D XD

Tom

  • Global Moderator
  • Legendary Member
  • *
  • Posts: 1373
  • "Witness me! I live, I die, I live again."
    • View Profile
Re: -=[How to]=- Make Scripts
« Reply #25 on: April 09, 2014, 05:40:51 AM »
Question for you Mud,  any look creating a Looping Scripts? . So far attempts have failed :P either I'm messing up somewhere along the line or they aren't designed for to loop.


(smacks you)

being stupid is gona start to hurt around here.

The White Rabbit

  • Legendary Member
  • *
  • Posts: 1468
  • Are you a solo builder too?
    • View Profile
  • Xbox: Nobodies56
  • PSN: A_Blessed_Potato
  • Steam: Ray
Re: -=[How to]=- Make Scripts
« Reply #26 on: April 09, 2014, 05:47:10 AM »
Question for you Mud,  any look creating a Looping Scripts? . So far attempts have failed :P either I'm messing up somewhere along the line or they aren't designed for to loop.

I tried that however it failed badly so I just created a script of copy and paste so much that I simply lost the will to work on it xD

 
Thanks GK for the new sig it looks great!
 
You may be able to teach a chimp to dance, but will he dance for your tune?

Tom

  • Global Moderator
  • Legendary Member
  • *
  • Posts: 1373
  • "Witness me! I live, I die, I live again."
    • View Profile
Re: -=[How to]=- Make Scripts
« Reply #27 on: April 09, 2014, 05:53:11 AM »
I tried that however it failed badly so I just created a script of copy and paste so much that I simply lost the will to work on it xD
I tried bypassing Script [name] function because that didn't allow for looping by using a circuit but it would not repower the script. For some reason it will not execute the script again, without physically flicking the switch of the original script block. I'm gonna try script commands to see if I can get it to work.


(smacks you)

being stupid is gona start to hurt around here.

The White Rabbit

  • Legendary Member
  • *
  • Posts: 1468
  • Are you a solo builder too?
    • View Profile
  • Xbox: Nobodies56
  • PSN: A_Blessed_Potato
  • Steam: Ray
Re: -=[How to]=- Make Scripts
« Reply #28 on: April 09, 2014, 05:55:50 AM »
I was working with script commands and kept drawing blanks and I really need this loop to make my airships fly in the distance :(

 
Thanks GK for the new sig it looks great!
 
You may be able to teach a chimp to dance, but will he dance for your tune?

muD

  • Legendary Member
  • *
  • Posts: 1177
    • View Profile
Re: -=[How to]=- Make Scripts
« Reply #29 on: April 09, 2014, 07:45:37 AM »
Question for you Mud,  any look creating a Looping Scripts? . So far attempts have failed :P either I'm messing up somewhere along the line or they aren't designed for to loop.
Yes I have made a couple of looping scripts, but there is a mech in place to stop recursive scripts

Quote from: Craig
I've also added a Script [scriptName] command, which allows you to execute another script inside a script. This allows you to write modular scripts, with each one doing only a specific task, and then you can call them as you need them (string them together) allowing for primitive script reuse.

Note the Script command will cause nested execution. The SetSwitch command also has the potential to do this, because the switch may activate another script as part of it's circuit.

In order to stop both excessive ram use and infinitely recursing scripts (script A calls script B which calls script A which calls script B), there is a limit of 20 nested scripts. Once the nested limit is reached, a script cannot execute another script (directly or indirectly) so eventually the nested scripts will unwind.
Source

can make simple loopers like so;

1: Script [1]
2: Commit
3: Wait [1000]
4: Script [2]
5: Commit
6: Wait [1000]
7: Script [1]
8: Commit
9: Wait [1000]
10: Script [2]
11: Commit

repeat as necessary, but there is a limit then it can't be looped by switches, buttons, scripts or anything.. will need a manual reboot if no one can find a way round it
« Last Edit: April 09, 2014, 08:34:21 AM by muD »