Author Topic: How to save variables to a text file?  (Read 1933 times)

0 Members and 1 Guest are viewing this topic.

Offline CoraginTopic starter

  • Wacko in Pajama's
  • Elite
  • *
  • *
  • Posts: 1641
  • Activity:
    0%
  • Reputation Power: 23
  • Coragin might someday be someone...Coragin might someday be someone...Coragin might someday be someone...Coragin might someday be someone...
  • Gender: Male
  • It Is What It Is.
  • Respect: +57
  • Referrals: 1
    • View Profile
How to save variables to a text file?
« on: January 25, 2010, 12:09:28 AM »
0
Lets say I want to save a container variable, so I dont have to re-click or run a setup every single time I run a script.  What would that sub look like?  Lets say we are saving the variable of a contain ID, just one single container.

Code: [Select]
Display OK Target your secure
  set #targcurs 1
  while #targcurs = 1
    wait 1
  set %secure #ltargetid

Now lets say I want to save the %secure variable to a text file, to be loaded next time the script is run, thus removing the need to re-run the above code.  What would that sub look like?  If someone can give me an example, I can do all my variables I got setup in a ton of scripts, mainly though you guessed it, this is for hort.
Coragin

My Facebook
And now I'm better at doing what ever it is Wolverine does!

Offline Endless Night

  • Global Moderator
  • *
  • *
  • Posts: 5467
  • Activity:
    0%
  • Reputation Power: 62
  • Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!
  • Respect: +393
  • Referrals: 1
    • View Profile
Re: How to save variables to a text file?
« Reply #1 on: January 25, 2010, 02:27:03 PM »
0
Code: [Select]
Sub Ens_LogLine ; %1 filename  %2 Text
  Execute %Cmd /c Echo %1 >> %2
Return

I would call it with

Code: [Select]
set !Text  Set , #spc , % , Secure , #spc , #ltargetid
gosub ens_logLine C:myfile.txt !text

Note .. ive forgot how you include the percent sign in a line of text .. it might be %% or other look at the help files to find out.

Note2 .. %Cmd should either be Cmd.exe or command.com depending on your os version.
Outlaw Josey Wales - "Manwink, A Long Gone Scripty, and Endless are always teasing us with their private sections lol. What there realy saying is scripters rule and users drool."
Briza - "Your a living breathing vortex of usefulness."

Offline manwinc

  • Elite
  • *
  • *
  • Posts: 2556
  • Activity:
    0%
  • Reputation Power: 32
  • manwinc is a rising star!manwinc is a rising star!manwinc is a rising star!manwinc is a rising star!manwinc is a rising star!manwinc is a rising star!
  • Gender: Male
  • "The Devs Hard at Work"
  • Respect: +123
  • Referrals: 1
    • View Profile
Re: How to save variables to a text file?
« Reply #2 on: January 25, 2010, 03:53:30 PM »
0
Take a look at ceo's Rail WRiter. it includes the %Symbol when it writes.
Monkeys and Typewriters!

" Oh I know, We'll make a Boss Encounter that requires 3 keys per player to enter, Then we'll make it not a closed instance so you never know if you are going to pop into a fresh room or a boss that has 1% Health left with 20 dudes smashing its face in, wasting your time and effort"

Tags: