Results 1 to 13 of 13

Thread: 2 Things at once?

  1. #1
    Join Date
    Dec 2011
    Posts
    25
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default 2 Things at once?

    Hi, was just wondering how I would get a script to do say two things at once, such as talk (TypeSendEx) and also click somewhere or use an item in the inventory etc? But both at the same time as at the moment I have it talking then doing the action when it's sent the message?

  2. #2
    Join Date
    Feb 2009
    Posts
    2,155
    Mentioned
    4 Post(s)
    Quoted
    42 Post(s)

    Default

    I think this is known as multithreading and pascal cannot do that.....

    may I ask why you need to type and click the mouse at the sametime.

  3. #3
    Join Date
    Dec 2011
    Posts
    25
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    It's just to learn, but I was gonna type and dance/any emote at the same time, I'm learning pascal

  4. #4
    Join Date
    Feb 2009
    Posts
    2,155
    Mentioned
    4 Post(s)
    Quoted
    42 Post(s)

    Default

    I do not think this can be done.

    Pascal is not an oop, it is linear.

  5. #5
    Join Date
    Feb 2012
    Location
    Discord
    Posts
    3,114
    Mentioned
    37 Post(s)
    Quoted
    538 Post(s)

    Default

    Quote Originally Posted by ILikeSmoothHeads View Post
    It's just to learn, but I was gonna type and dance/any emote at the same time, I'm learning pascal
    Quote Originally Posted by JPHamlett View Post
    I do not think this can be done.

    Pascal is not an oop, it is linear.
    yeah can't be done, atleast not to my knowledge.
    You can however have a script click the emote then type
    shouldn't be much delay. I'v already got a private one of these that works fine

  6. #6
    Join Date
    Jan 2008
    Location
    10° north of Hell
    Posts
    2,035
    Mentioned
    65 Post(s)
    Quoted
    164 Post(s)

    Default

    Stop saying Pascal.

    Simba uses an interpreter called PascalScript, which doesn't support classes in the script.
    Tho we do pass some classes to it, (Ex: TForm).
    PascalScript is also not OOP. Except passed classes^

    Pascal however is completely different, Simba was written in FreePascal which is OOP and supports threading.

    Tho you are correct, in scripts you can only do this if you waste your time writing functions that do both at the same time, you can't thread in scripts.

    Dg's Small Procedures | IRC Quotes
    Thank Wishlah for my nice new avatar!
    Quote Originally Posted by IRC
    [22:12:05] <Dgby714> Im agnostic
    [22:12:36] <Blumblebee> :O ...you can read minds

  7. #7
    Join Date
    Oct 2011
    Location
    Australia, Vic
    Posts
    1,517
    Mentioned
    2 Post(s)
    Quoted
    120 Post(s)

    Default

    You can do this...

    Just run through the "ClickEmote" function/procedure and then the type send.
    It might not be exactly at the same time but He would still be dancing and saying stuff at the same time as long as you make it go through the functions fast.

  8. #8
    Join Date
    Feb 2012
    Location
    DON'T PM ME ASKING FOR STUFF
    Posts
    2,170
    Mentioned
    38 Post(s)
    Quoted
    423 Post(s)

  9. #9
    Join Date
    Nov 2012
    Posts
    2,351
    Mentioned
    55 Post(s)
    Quoted
    603 Post(s)

    Default

    Quote Originally Posted by xtrapsp View Post
    Can while do not work?
    still going to be going down the lines one at a time

    Whatever simba uses (pascal, pascal script, free pascal, something?), like mentioned above, doesent support multi-threading, and is not OOP, meaning you cant do two things at once, you can simulate it, but you cant for example check a timer, while in another loop, you have to check the timer inside that loop
    Last edited by DannyRS; 12-17-2012 at 01:21 PM.


    Programming is like trying keep a wall of shifting sand up, you fix one thing but somewhere else starts crumbling

  10. #10
    Join Date
    Feb 2012
    Location
    DON'T PM ME ASKING FOR STUFF
    Posts
    2,170
    Mentioned
    38 Post(s)
    Quoted
    423 Post(s)

    Default

    Quote Originally Posted by DannyRS View Post
    still going to be going down the lines one at a time
    Do a function for one thing and another for something else then in the mainloop use it? or does that not work?

  11. #11
    Join Date
    Nov 2012
    Posts
    2,351
    Mentioned
    55 Post(s)
    Quoted
    603 Post(s)

    Default

    Quote Originally Posted by xtrapsp View Post
    Do a function for one thing and another for something else then in the mainloop use it? or does that not work?
    it will execute the lines from both functions one by one though,

    for example, you cant run an eat handler, while using a fight handler,

    because you have to like, run combat lines, check food stuff, run combat lines, check food stuff

    the interpreter only reads linearly (correct word?), it cant run multiple functions at once


    Programming is like trying keep a wall of shifting sand up, you fix one thing but somewhere else starts crumbling

  12. #12
    Join Date
    Feb 2012
    Location
    DON'T PM ME ASKING FOR STUFF
    Posts
    2,170
    Mentioned
    38 Post(s)
    Quoted
    423 Post(s)

    Default

    Quote Originally Posted by DannyRS View Post
    it will execute the lines from both functions one by one though,

    for example, you cant run an eat handler, while using a fight handler,

    because you have to like, run combat lines, check food stuff, run combat lines, check food stuff
    Hmm, makes sense.

    Does Simba allow the use of AND etc?
    Simba Code:
    procedure mainloop;
    begin
    run; and eat;
    end;

    but I suppose that would still be doing it one after another.

  13. #13
    Join Date
    Nov 2012
    Posts
    2,351
    Mentioned
    55 Post(s)
    Quoted
    603 Post(s)

    Default

    yea still going to go through run; then exit that and start eat;

    OOP multithreading would allow you to fight in combat, and also cause an eat command to go off, without ever needing to call it in the fighting function

    its helpful, but once you get into the linear style, checking for food and stuff at the end of a fight function or inside a loop waiting for combat to end, doesent really matter a great deal


    Programming is like trying keep a wall of shifting sand up, you fix one thing but somewhere else starts crumbling

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •