+ Reply to Thread
Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: E2 help (wait?)

  1. #1
    Wire Noob HKcole's Avatar
    Join Date
    Aug 2010
    Posts
    2

    Question E2 help (wait?)

    ok so im making a chip.
    i don't have the code now but what it does it every 3 seconds the sign(text screen) changes to another string.
    at first i thought a lua code (wait(100)) would work.
    but it didnt.
    somone help? D:

  2. #2
    Ursus maritimus Drunkie's Avatar
    Join Date
    Feb 2009
    Location
    Canada
    Posts
    5,657
    Blog Entries
    1

    Default Re: E2 help (wait?)


  3. #3
    Wire Noob HKcole's Avatar
    Join Date
    Aug 2010
    Posts
    2

    Default Re: E2 help (wait?)

    Quote Originally Posted by Drunkie View Post
    still unresolved.
    thanks for trying? -_-

  4. #4
    Ursus maritimus Drunkie's Avatar
    Join Date
    Feb 2009
    Location
    Canada
    Posts
    5,657
    Blog Entries
    1

    Default Re: E2 help (wait?)

    Be more specific then. I thought you were asking for something similar to a wait command.

  5. #5
    Sol
    Sol is offline
    Wire Amateur Sol's Avatar
    Join Date
    Jul 2010
    Posts
    33

    Default Re: E2 help (wait?)

    An interval(3000) would make your code execute every 3 seconds, if you want something changing every 3 seconds that's probably what you need :/

  6. #6
    Wire Amateur Flyingtaco's Avatar
    Join Date
    Aug 2010
    Posts
    61

    Default Re: E2 help (wait?)

    If you want it to go to a random one every three seconds you could do something like this

    for 5 strings
    Code:
    @name Random String thingy
    @outputs RandomString:string
    @persist Number String1:string String2:string String3:string String4:string String5:string
    interval(3000)
    Number=round(random(1,5))
    String1="A"
    String2="B"
    String3="C"
    String4="D"
    String5="E"
    if(Number==1){RandomString=String1}
    if(Number==2){RandomString=String2}
    if(Number==3){RandomString=String3}
    if(Number==4){RandomString=String4}
    if(Number==5){RandomString=String5}
    Last edited by Flyingtaco; 08-03-2010 at 09:56 PM.

  7. #7
    Ursus maritimus Drunkie's Avatar
    Join Date
    Feb 2009
    Location
    Canada
    Posts
    5,657
    Blog Entries
    1

    Default Re: E2 help (wait?)

    Quote Originally Posted by Flyingtaco View Post
    If you want it to go to a random one every three seconds you could do something like this

    for 5 strings
    Code:
    @name Random String thingy
    @outputs RandomString:string
    @persist Number String1:string String2:string String3:string String4:string String5:string
    interval(3000)
    Number=round(random(1,5))
    String1="A"
    String2="B"
    String3="C"
    String4="D"
    String5="E"
    if(Number=1){RandomString=String1}
    if(Number=2){RandomString=String2}
    if(Number=3){RandomString=String3}
    if(Number=4){RandomString=String4}
    if(Number=5){RandomString=String5}
    That code will not work, you have to use the == operator for comparisons.

  8. #8
    NOT A CUNT Ninja101's Avatar
    Join Date
    Dec 2008
    Location
    West Midlands, UK
    Posts
    637

    Default Re: E2 help (wait?)

    Code:
    @name RandString
    @persist Strings:array String
    interval(3000)
    Strings[1, string] = "1"
    Strings[2, string] = "2"
    Strings[3, string] = "3"
    String = Strings[round(randint(1, 3)), string]
    Shortened :3
    Last edited by Ninja101; 08-03-2010 at 08:37 PM. Reason: Forgot interval() :3
    Quote Originally Posted by Anticept View Post
    Heroes of Newerth

  9. #9
    Wire Sofaking jacoby6000's Avatar
    Join Date
    Feb 2008
    Location
    behind you when you aren't looking
    Posts
    792

    Default Re: E2 help (wait?)

    Quote Originally Posted by Ninja101 View Post
    Code:
    @name RandString
    @persist Strings:array String
    interval(3000)
    Strings = array("1","2","3")
    String = Strings[round(randint(1, Strings:count())), string]
    Shortened :3

    Shortened* and can add any number of strings
    Quote Originally Posted by Garrysmod View Post
    Warning: You're trying to render in the wrong place. This doesn't play nice with multi-core rendering, so we're not going to let you draw here.
    I'm not stupid!
    In [his] experience that was a sentence never to be uttered except to prove its own inaccuracy
    --Orson Scott Card

  10. #10
    Wire Amateur Flyingtaco's Avatar
    Join Date
    Aug 2010
    Posts
    61

    Default Re: E2 help (wait?)

    See even though my code had the equal sign problem it still managed to get a nice code.
    Last edited by Flyingtaco; 08-05-2010 at 04:10 PM.

+ Reply to Thread
Page 1 of 2 12 LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
proceed-collector
proceed-collector
proceed-collector
proceed-collector
linguistic-parrots
linguistic-parrots
linguistic-parrots
linguistic-parrots