Jump to content

Random Scripting


Recommended Posts

Not sure if this is the right spot for this in this forum.

Here is what i have going on.

I have a GUI i am working on.

I want to be able to script this gui as a random riddle generator with a single button

when that button is clicked it will load a random riddle into a text field (not editable)

and display the answer in another text field (also not editable)

i would like to make a 3rd button that will enable me to type in in a seperate window a new riddle, and its answer, so that i have an easy way of updating the database.....

Anyone have a clue how i could do this?

Thanks in advance.

Krazyk - The Doctor is In.

Link to comment
Share on other sites

What have you tried? What format is your "riddle" file in? Did you run the example scripts in the help file for FileReadLine(), GuiCreate(), or GuiCtrlCreateEdit()?

It is hard to help you without knowing where you got stuck.

:unsure:

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

I would like to start with my second button (Submit Riddle)

3 questions for it.

1. After entering text into field, and answer into second field, how would i make the script save it to a file, that it can call to.

2. How would i make it save that file with a unique identifier every single time....example------12.*enter file extension*

3. How would i be able to delete redundant data (Duplicate riddles) or obsolete date, without the script jamming up.

4. how could i do this all and make the script recompile itself into a new .exe when done, EVERY TIME I click submit.

After i figure out the second button, here is the first button (Random Riddle)

Click random button and in text field (a)Display random riddle, and text field (b)Display the answer.

3 Questions for it.

1. How would i make the button "Randomly chose" a value between say 1-100 and open the corresponding riddle file.

2. If there is no riddle file with that identifier, how would i make it keep picking random numbers till it finaly finds one.

3. Once found, how can i make it Input the "Riddle" into text field (a) only, and the answer into text field (:unsure:

Finally, How do i get rid of these Scrollbars that are grayed out.

Below is an attached copy of my script.

Thanks in advance for anyones and everyones help.

Krazyk.

test.au3

Link to comment
Share on other sites

Hi

Don't see any Scrollbars that are grayed out in your script! Will help if you post as much as possible to get help.

Also have some important questions:

* How long will the question(s) be?

* How long will the answer(s) be?

* Do you really want each question/answer in a seperate file?

* Did you read up on INI files?

* How many questions / answers in total?

Link to comment
Share on other sites

Hi

Don't see any Scrollbars that are grayed out in your script! Will help if you post as much as possible to get help.

Also have some important questions:

* How long will the question(s) be?

* How long will the answer(s) be?

* Do you really want each question/answer in a seperate file?

* Did you read up on INI files?

* How many questions / answers in total?

Questions will be no more than 120 characters, possibly 3 lines of text tops.

Answers will be no more than 80 characters, 2 lines of text.

Do you know of any other solutions to put answers and questions together, without using a file?

What do you mean read up on .ini Files?

I dont want a size limit. For there are an endless supply of riddles out there.

post-64052-0-95299400-1303191523_thumb.j

test.au3

Edited by Krazyk
Link to comment
Share on other sites

Hi Krazyk,

It seems you have not tried enough or done sufficient research and as such you are asking us very general questions to which there are a host of solutions. However, I would recommend, for riddle storage SQLite or other DBMS. Search the help file for examples of using SQLite with AutoIt. This will streamline adding/deleting/updating of riddles and will also be least resistant in accommodating methods of reducing data redundancy. Good luck.

-smartee

Link to comment
Share on other sites

Questions will be no more than 120 characters, possibly 3 lines of text tops.

Answers will be no more than 80 characters, 2 lines of text.

Do you know of any other solutions to put answers and questions together, without using a file?

What do you mean read up on .ini Files?

I dont want a size limit. For there are an endless supply of riddles out there.

A searh on +flash +card will get you a good head start.

IniRead / IniWrite / IniDelete etc. is a must for small data bases.

However on the long run and with bigger databases I agree with SmarTee SQLite is the way to go.

Link to comment
Share on other sites

A searh on +flash +card will get you a good head start.

IniRead / IniWrite / IniDelete etc. is a must for small data bases.

However on the long run and with bigger databases I agree with SmarTee SQLite is the way to go.

Thank you...Both of you.

SQLite seems to be my solutions.... If i run into any issues, i will repost here.

Thanks Again.

You guys rock, and this community rocks.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...