Page 1 of 2 12 LastLast
Results 1 to 25 of 27

Thread: a type with subtypes in subtypes

  1. #1
    Join Date
    Mar 2010
    Location
    New Hampshire, U.S.A
    Posts
    586
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default a type with subtypes in subtypes

    i am making a qc autochat script. i am recording all of the QC options and i want to store them in their own type, since i cant think of any other way to organise them. i want to be able to type something like: qc.general.hello.Hello! and it will have he value 'Hello!'

    if ther is any other way to organise the qc menu, i would love to hear it. lol.

    EDIT: i just thought of using arrays in arrays instead, i think it would work, still love sugestions though
    Sell botted goods at mid to high prices!!! Else we lose our profit AND ruin the game!!!!

  2. #2
    Join Date
    Nov 2007
    Location
    46696E6C616E64
    Posts
    3,069
    Mentioned
    44 Post(s)
    Quoted
    302 Post(s)

    Default

    Make the last an array, like qc.general.hello[1]
    There used to be something meaningful here.

  3. #3
    Join Date
    Mar 2010
    Location
    New Hampshire, U.S.A
    Posts
    586
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    i was thinking of that before, lol, but then i would have to do that for every submenu, and ther is like just as many submenus as messages :P. so still wouldnt work. i dont think so at least
    Sell botted goods at mid to high prices!!! Else we lose our profit AND ruin the game!!!!

  4. #4
    Join Date
    Sep 2006
    Posts
    5,219
    Mentioned
    4 Post(s)
    Quoted
    1 Post(s)

    Default

    You could go arrays all the way down:
    Code:
    var 
      QC: array of array of array of string;
    begin
      QC[0][0][0] := 'Hi';
    or even
    Code:
    var 
      QC: array of array of array of string;
    const
      General = 0;
      Hello = 0;
    begin
      QC[General][Hello][0] := 'Hi';
    ......
    writeln(QC[General][Hello][random(length(QC[General][Hello]))]);

  5. #5
    Join Date
    Jan 2010
    Posts
    5,227
    Mentioned
    6 Post(s)
    Quoted
    60 Post(s)

    Default

    Or you could make them vars and inc them, I think.

  6. #6
    Join Date
    Mar 2010
    Location
    New Hampshire, U.S.A
    Posts
    586
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    cant inc text :S

    the best way i have thought of is using numbers instead of text, but that will make rhe script more confusing. for me AND others
    Sell botted goods at mid to high prices!!! Else we lose our profit AND ruin the game!!!!

  7. #7
    Join Date
    Jul 2008
    Location
    England
    Posts
    763
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by g0tp0t View Post
    cant inc text :S

    the best way i have thought of is using numbers instead of text, but that will make rhe script more confusing. for me AND others
    Constants...?
    lol

  8. #8
    Join Date
    May 2006
    Location
    Amsterdam
    Posts
    3,620
    Mentioned
    5 Post(s)
    Quoted
    0 Post(s)

    Default

    pascal Code:
    program new;
    type
      SubType2 = record
        Hello : string;
      end;
      Subtype1 = record
        Hello : subtype2;
      end;
      Holder = record
        General : subtype1;
      end;
    var
      QC : Holder;
    begin
      QC.General.Hello.Hello := 'Hello';
      Writeln(QC.General.Hello.Hello);
    end.
    Verrekte Koekwous

  9. #9
    Join Date
    Mar 2010
    Location
    New Hampshire, U.S.A
    Posts
    586
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    ur a freaking genius!!! luv u!! lol, omfg u figured it out, this is EXACTLY what i wanted, i thought it might be available only in plugins. guess not. :P. k, ill get working on it. oh and i also have had a change of mind, im going form QC chatbot to speaking AI, once i get it written so it is easiy updated with new messages and replies i will upload it, and let the community start making the database. much faster
    Sell botted goods at mid to high prices!!! Else we lose our profit AND ruin the game!!!!

  10. #10
    Join Date
    Jan 2007
    Posts
    8,876
    Mentioned
    123 Post(s)
    Quoted
    327 Post(s)

    Default

    I would suggest you to read a basic tutorial on scripting before attempting this

  11. #11
    Join Date
    Mar 2010
    Location
    New Hampshire, U.S.A
    Posts
    586
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    ...umm, i have, like 3 years ago, what makes u think i need, i have never seen any ref of holders...
    Sell botted goods at mid to high prices!!! Else we lose our profit AND ruin the game!!!!

  12. #12
    Join Date
    Nov 2007
    Location
    46696E6C616E64
    Posts
    3,069
    Mentioned
    44 Post(s)
    Quoted
    302 Post(s)

    Default

    Quote Originally Posted by g0tp0t View Post
    ...umm, i have, like 3 years ago, what makes u think i need, i have never seen any ref of holders...
    Holders?
    There used to be something meaningful here.

  13. #13
    Join Date
    Mar 2010
    Location
    New Hampshire, U.S.A
    Posts
    586
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    nevermind, im an idiot, i hadnt really looked a thee codeextnsivly since im in school, ofcusing on other things, lol, so its just a type in a type in a type which i didnt think you could do.
    Sell botted goods at mid to high prices!!! Else we lose our profit AND ruin the game!!!!

  14. #14
    Join Date
    Oct 2007
    Location
    #srl
    Posts
    6,102
    Mentioned
    39 Post(s)
    Quoted
    62 Post(s)

    Default

    Quote Originally Posted by g0tp0t View Post
    nevermind, im an idiot, i hadnt really looked a thee codeextnsivly since im in school, ofcusing on other things, lol, so its just a type in a type in a type which i didnt think you could do.
    No, they are 3 different types. They just call upon each other, creating the effect that you wanted.

  15. #15
    Join Date
    Mar 2010
    Location
    New Hampshire, U.S.A
    Posts
    586
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    lol, i dont think that matters but thaanks 4 the insight ^.^
    Sell botted goods at mid to high prices!!! Else we lose our profit AND ruin the game!!!!

  16. #16
    Join Date
    Aug 2008
    Location
    Finland
    Posts
    2,851
    Mentioned
    3 Post(s)
    Quoted
    2 Post(s)

    Default

    Quote Originally Posted by Boreas View Post
    You could go arrays all the way down:
    Code:
    var 
      QC: array of array of array of string;
    begin
      QC[0][0][0] := 'Hi';
    or even
    Code:
    var 
      QC: array of array of array of string;
    const
      General = 0;
      Hello = 0;
    begin
      QC[General][Hello][0] := 'Hi';
    ......
    writeln(QC[General][Hello][random(length(QC[General][Hello]))]);
    Quote Originally Posted by g0tp0t View Post
    lol, i dont think that matters but thaanks 4 the insight ^.^
    This is the best way to do it. Easiest and able to be applied to loops if needed. With this method you can also do what Boreas said:
    writeln(QC[General][Hello][random(length(QC[General][Hello]))]);
    Which will pick a random message from the "General >> Hello" section.

  17. #17
    Join Date
    Jan 2010
    Posts
    5,227
    Mentioned
    6 Post(s)
    Quoted
    60 Post(s)

    Default

    ^ I concur. And what I was saying about incrementing them is that if you set QC[General] to "Hi." or something (which would be QC[0], really), you could increment General and then QC[General] would then be "Hello." or whatever QC[1] would be.

  18. #18
    Join Date
    Mar 2010
    Location
    New Hampshire, U.S.A
    Posts
    586
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    when i said you cant inc text, i hadnt seen the const. lol

    that is a good idea, but i think i have a different aproach now, since it will be an ai sort of thing.

    Basically, i will have like 60 general keywords, and another 1k that are specific to runescape. depending on the mix of what is said, alond with a check for words like 'not' and 'awesome' and others that could greatly change meaning / context of what was said. ill open it up when im mem

    EDIT: this message was sitting in quick reply box since shortly after that explanation. im slow :P
    Sell botted goods at mid to high prices!!! Else we lose our profit AND ruin the game!!!!

  19. #19
    Join Date
    Jan 2010
    Posts
    5,227
    Mentioned
    6 Post(s)
    Quoted
    60 Post(s)

    Default

    I have a few computers I've nothing to do with. I was gonna have them just run a bunch of accounts in different worlds at popular areas where it'll just record what people say. I could set that up relatively quickly if you'd like to. It could be useful for that AI responder. To have a library of virtually everything that people say (I could constantly update it) would help.

  20. #20
    Join Date
    Mar 2010
    Location
    New Hampshire, U.S.A
    Posts
    586
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    okay, this is DEFINITELY the most awesome post i have ever seen, lets make a script that automatically uploads to a database i make online?? i could do it, except i have no experience interacting with databases :[. someone could help a little??
    Sell botted goods at mid to high prices!!! Else we lose our profit AND ruin the game!!!!

  21. #21
    Join Date
    Oct 2006
    Posts
    1,211
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    That seems like a really neat idea guys. I would love to see how that turns out... Let me know if you get that script done and I'll run it a bit.
    Extinct.

    Formally known as Drags111.

  22. #22
    Join Date
    Nov 2007
    Location
    46696E6C616E64
    Posts
    3,069
    Mentioned
    44 Post(s)
    Quoted
    302 Post(s)

    Default

    Quote Originally Posted by drags111 View Post
    That seems like a really neat idea guys. I would love to see how that turns out... Let me know if you get that script done and I'll run it a bit.
    Im good with php+mysql
    There used to be something meaningful here.

  23. #23
    Join Date
    Mar 2010
    Location
    New Hampshire, U.S.A
    Posts
    586
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    OK, i definitely need frements help then, and when i'm a member this will become an open source project. the only reason it isn't open right now, is that i don't want jagex going through it and creating a detector that will find people responding the same way this script will. it could completely compromise the script. i might just be really paranoid :P
    Sell botted goods at mid to high prices!!! Else we lose our profit AND ruin the game!!!!

  24. #24
    Join Date
    Jan 2010
    Posts
    5,227
    Mentioned
    6 Post(s)
    Quoted
    60 Post(s)

    Default

    Well I have no idea what you're talking about, but I already have things worked out with Frement, and he has the PHP done as far as I know. I've ran my script to get what people say. Returns names and what people say. I'll have the honor to go through it manually to detect responses and what not, until I figure out how to completely automate it. Frement and I were thinking about just going to a place where a couple people were talking and use that to find general ways that people respond.

    Should be figured out relatively soon, and I have a few computers to run the script on virtually nonstop, as long as Frement has enough space to hold all of that information.

  25. #25
    Join Date
    Nov 2007
    Location
    46696E6C616E64
    Posts
    3,069
    Mentioned
    44 Post(s)
    Quoted
    302 Post(s)

    Default

    Quote Originally Posted by i luffs yeww View Post
    Well I have no idea what you're talking about, but I already have things worked out with Frement, and he has the PHP done as far as I know. I've ran my script to get what people say. Returns names and what people say. I'll have the honor to go through it manually to detect responses and what not, until I figure out how to completely automate it. Frement and I were thinking about just going to a place where a couple people were talking and use that to find general ways that people respond.

    Should be figured out relatively soon, and I have a few computers to run the script on virtually nonstop, as long as Frement has enough space to hold all of that information.
    40GB should be enough And I will be tweaking the database viewer also when I get some more time.
    There used to be something meaningful here.

Page 1 of 2 12 LastLast

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
  •