unavailable Posted December 7, 2015 Share Posted December 7, 2015 Hi guys, I was wondering how I can create like a wordbank. In either an array or maybe in a .txt file to list the words. And then SCAR randomly takes one of the lines, and does a TypeText. Quote Link to comment Share on other sites More sharing options...
BryceTheCoder Posted December 8, 2015 Share Posted December 8, 2015 Hi guys, I was wondering how I can create like a wordbank. In either an array or maybe in a .txt file to list the words. And then SCAR randomly takes one of the lines, and does a TypeText. This is a very simple concept. I put an example together for you: http://pastebin.com/vNcMJRUE Quote Link to comment Share on other sites More sharing options...
unavailable Posted December 8, 2015 Author Share Posted December 8, 2015 Hey, thanks man! The first line makes Compiler Error; Identifier expected? Im trying to make something like this: function GetRandomWord() : string; var words : TStrArray; begin words := ['Apple', 'Banana', 'Peach', 'Blueberry']; result := words[Random(length(words))]; end; TypeText(GetRandomWord()); Wait(random(500)); TypeText(#13); Quote Link to comment Share on other sites More sharing options...
Wanted Posted December 8, 2015 Share Posted December 8, 2015 You need a ' begin code here end. ' for the last 3 lines.. e.g function Something: string; begin end; begin TypeText(Something); end. Quote Link to comment Share on other sites More sharing options...
BryceTheCoder Posted December 9, 2015 Share Posted December 9, 2015 Hey, thanks man! The first line makes Compiler Error; Identifier expected? Im trying to make something like this: function GetRandomWord() : string; var words : TStrArray; begin words := ['Apple', 'Banana', 'Peach', 'Blueberry']; result := words[Random(length(words))]; end; TypeText(GetRandomWord()); Wait(random(500)); TypeText(#13); All I have given you was the function that you can now select random words from. You will still need your "main" being and end of the entire program. So your code, that it looks like you are trying to do is something like this: function GetRandomWord() : string; var words : TStrArray; begin words := ['Apple', 'Banana', 'Peach', 'Blueberry']; result := words[Random(length(words))]; end; begin TypeText(GetRandomWord); Wait(random(500)); end. Quote Link to comment Share on other sites More sharing options...
unavailable Posted December 9, 2015 Author Share Posted December 9, 2015 (edited) The very first line still produces compiler error: function GetRandomWord() : string; "Identifier expected" Im using SCAR 3.41 EDIT: Never mind figured it out starting from the buttom, and adding on what I wanted. Thanks for the help guys! Edited December 9, 2015 by unavailable Quote Link to comment Share on other sites More sharing options...
BryceTheCoder Posted December 17, 2015 Share Posted December 17, 2015 The very first line still produces compiler error: function GetRandomWord() : string; "Identifier expected" Im using SCAR 3.41 EDIT: Never mind figured it out starting from the buttom, and adding on what I wanted. Thanks for the help guys! No problem, enjoy Quote Link to comment Share on other sites More sharing options...