Sign in to follow this  
Followers 0
Daywap

Can you help me?

20 posts in this topic

Hi I am making random user agent maker on firefox, can anyone help me?

First that I need to. Get random line from text and print in.

Second I need to make it run every 2 minutes. (loop?)

#Include <FF.au3>

_FFStart("about:config")
_FFPrefSet("general.useragent.override", "MY RANDOM USER AGENT SHOULD BE HERE :P")

Any ideas?

Share this post


Link to post
Share on other sites



Yes: Go make it.

So maybe you can help me? I need get random line from file, how to do it?

Share this post


Link to post
Share on other sites

Seeing how you are new, I would suggest you take AutoIt 1 2 3 and review the help file.

Noo.. Cmon just say me how to get random line from text file. PLEEEEASE :)

Share this post


Link to post
Share on other sites

What I am doing wrong with random?

#Include <FF.au3>

_FFConnect()


_FFPrefSet("general.useragent.override", "Random(1, 10)")

Share this post


Link to post
Share on other sites

Can you show me? Bad English, sorry ;\

Share this post


Link to post
Share on other sites

"Random(1, 10)"

must be

Random(1, 10)

" -> Double Quote (but you could have spent a little time to figure that out yourself.)

Jos :)


Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

"Random(1, 10)"

must be

Random(1, 10)

" -> Double Quote (but you could have spent a little time to figure that out yourself.)

Jos :)

I already tried it, but it wont work

#Include <FF.au3>

_FFConnect()


_FFPrefSet("general.useragent.override", Random(1, 10))

I mean when I make not random it works.

Share this post


Link to post
Share on other sites

#13 ·  Posted (edited)

Random works fine:

MsgBox(0,"random",Random(1, 10))

Maybe you need an Integer as output of the random() func, just check the helpfile for that.

Edited by Jos

Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Random works fine:

MsgBox(0,"random",Random(1, 10))

Maybe you need an Integer as output of the random() func, just check the helpfile for that.

I searched for that about for 30minutes and nothing :). Cmon is that so hard? Please just show me where I have to write random ;). PPPLEEEAAASEE B)

Share this post


Link to post
Share on other sites

I searched for that about for 30minutes and nothing :). Cmon is that so hard? Please just show me where I have to write random ;). PPPLEEEAAASEE B)

Where did you search? The helpfile?

Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Where did you search? The helpfile?

Yes, I mean I found something but have no idea how to use it

Share this post


Link to post
Share on other sites

Yes, I mean I found something but have no idea how to use it

How difficult can this be?

Random

--------------------------------------------------------------------------------

Generates a pseudo-random float-type number.

Random ( [Min [, Max [, Flag]]] )

Parameters

Min [optional] The smallest number to be generated. The default is 0.

Max [optional] The largest number to be generated. The default is 1.

Flag [optional] If this is set to 1 then an integer result will be returned. Default is a floating point number.


Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

How difficult can this be?

Something like this? Not really working :)

#Include <FF.au3>

_FFConnect()

$var = Int(Random(1, 6, 1))
_FFPrefSet("general.useragent.override", $var)

Share this post


Link to post
Share on other sites

I searched for that about for 30minutes and nothing ;). Cmon is that so hard? Please just show me where I have to write random B). PPPLEEEAAASEE B)

If you have such big problems with such easy functions then you definitely should either more read helpfile (and its examples) or quit scripting  :)

Share this post


Link to post
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
Sign in to follow this  
Followers 0