Author Topic: Looking for a tutorial on creating data files  (Read 8375 times)

0 Members and 1 Guest are viewing this topic.

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: Looking for a tutorial on creating data files
« Reply #15 on: November 21, 2012, 03:16:23 PM »
0
A lot of cool stuff we can do with this. 

Could you share what you did to calculate character count?

From my character toolbox script

Code: [Select]
; ---------------------------------------
; log subs
;----------------------------------------

sub DumpOutputToFile
 set %oldlpc #lpc
 set #lpc 5000
 set !AutoOpenNotePad %1
 set !ResultFile %2

 If %OutputLines <> N/A && %OutputLines > 99
   {
   goSub FileIoStringFormat %Output100
   Set !BufferText Echo , #spc , #Result , #spc , > , #SPC , !Resultfile
   If %OutputLines > 100
     {
     For !x 101 %OutputLines
       {
       goSub FileIoStringFormat %Output . !x
       str Len !BufferText
       If #StrRes > 0
         Set !BufferText !BufferText , #spc , && , #spc , Echo , #spc , #result , #spc , >> , #spc , !Resultfile
       ELSE
         Set !BufferText Echo , #spc , #Result , #spc , >> , #spc , !Resultfile

       IF #strres > 1700
         {
;         display ok !BufferText
         Execute cmd.exe /c !BufferText
         set !BufferText
         wait 5
         }
       }
     }
   str Len !BufferText
   If #strres > 0
     Execute cmd.exe /c !BufferText
   }

 IF !AutoOpenNotePad = #True
    Execute Notepad !ResultFile

 Set #lpc %oldLpc
Return

Sub FileIoStringFormat
  Str Len %1
  set !NewString
  For !xxcount 1 #Strres
    {
     Str Mid %1 !xxcount 1
     If #StrRes In &|();.%
       Set !NewString !NewString , ^ , #strres
     Else
       Set !NewString !NewString , #strres
    }
Return !NewString

sub RecordOutput
  If %0 > 0 && %0 <> N/A
    {
    If %OutputLines = N/A
       Set %OutputLines 99
    Set %OutputLines %OutputLines + 1
    Set %Output . %OutputLines
    For !Count 1 %0
      Set %Output . %OutputLines %Output . %OutputLines , #spc , % . !Count
    }
return
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 PauloniusTopic starter

  • Elite
  • *
  • *
  • Posts: 2040
  • Activity:
    0%
  • Reputation Power: 29
  • Paulonius is on the verge of being accepted.Paulonius is on the verge of being accepted.Paulonius is on the verge of being accepted.Paulonius is on the verge of being accepted.Paulonius is on the verge of being accepted.
  • Respect: +162
  • Referrals: 1
    • View Profile
Re: Looking for a tutorial on creating data files
« Reply #16 on: November 26, 2012, 04:57:28 AM »
0
Using EN's data file tool I wrote a simple hotkey script to write a rail data file as follows:

Code: [Select]
Set %Rail_Name SPR1
Set %File_Name %Rail_Name
Set %File_Name_txt %File_Name , .txt
Set %File_Path C:\Users\CRS\Desktop\EUO\
Set %File_Path_And_Name_txt %File_Path , %File_Name_txt
Set %WP_Save WP
GoSub ENs_ClearFile %File_Path_And_Name_txt
Set %X 0
Repeat
      {
      onhotkey f4
      Set %HotKey4 True
      onhotkey f5
      Set %HotKey5 True
      If %HotKey4 = True
         {
         Set %X %X + 1
         Set %WP_Save . %X %WP_Save , %X
         Set %WP . %X X . #CHARPOSX , Y . #CHARPOSY , Z . #CHARPOSZ
         Event exmsg #charid 3 4 %WP . %X
         gosub ENs_SaveData %File_Path_And_Name_txt %WP_Save . %X
         Set %HotKey4 False
         }
      }
Until %HotKey5 = True
Set %WP_Count %X
Gosub ENs_SaveData %File_Path_And_Name_txt WP_Count
Halt


I ran the code, hit F4 four times and then hit F5. The rail file is named SPR1 and looks like this:

Code: [Select]
; ENs Var Save
Set %WP1 X2164Y2169Z7
Set %WP2 X2164Y2169Z7
Set %WP3 X2164Y2169Z7
Set %WP4 X2164Y2169Z7
Set %WP_Count 4

Next I will add in the character count code.
This coin declares Caesar is "Dictator for Life." He did serve as Dictator for the remainder of his life, but his life would end only a few weeks after this issue. For Caesar to put his image on coins and essentially declare himself king was too much for Brutus and his republican allies.

"If everything seems under control, you're not going fast enough'
-Mario Andretti

"If everyone is thinking alike, someone isn't thinking."
- General George Patton Jr

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: Looking for a tutorial on creating data files
« Reply #17 on: November 26, 2012, 08:11:22 AM »
0
nice Paulonius  ..
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 PauloniusTopic starter

  • Elite
  • *
  • *
  • Posts: 2040
  • Activity:
    0%
  • Reputation Power: 29
  • Paulonius is on the verge of being accepted.Paulonius is on the verge of being accepted.Paulonius is on the verge of being accepted.Paulonius is on the verge of being accepted.Paulonius is on the verge of being accepted.
  • Respect: +162
  • Referrals: 1
    • View Profile
Re: Looking for a tutorial on creating data files
« Reply #18 on: November 27, 2012, 06:56:51 AM »
0
I modified the waypoint recording script to use hashmarks to break up the data points so that I could use TM's string parser to break them up when I pull them into a script.

Then I added a step by step pathfind through the waypoints by modifying the waypoint script, and used that to create a second script that will make files for hatchet/shovel strikes along the waypoint, using a similar naming convention.

I now have a set of scripts that I can use to make rails for mining or lumberjacking. It takes about five minutes to record a decent rail, and another 5-10 to add the shovel/hatchet data points.
This coin declares Caesar is "Dictator for Life." He did serve as Dictator for the remainder of his life, but his life would end only a few weeks after this issue. For Caesar to put his image on coins and essentially declare himself king was too much for Brutus and his republican allies.

"If everything seems under control, you're not going fast enough'
-Mario Andretti

"If everyone is thinking alike, someone isn't thinking."
- General George Patton Jr

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: Looking for a tutorial on creating data files
« Reply #19 on: November 27, 2012, 08:48:30 AM »
0
sweet... That sounds like some nice work .. custom rails for the win

Have you ever checked out my super compressed rail system thats in the character tool box...   The rail to move from newchar spot in new haven to the new haven inn is 34k2z1f1h7d193ZNCf1  and to move from the new haven inn to new haven moongate is 30d593ZNCk5h4s5f6e75l6n7z5a5d6z5o5c7w5t7a5  from luna moongate to luna inn is 36g1g7f5a7f1p7a593BQCf5a3

A complex rail in one Var.  ;)   Only action it currently supports is opening doors thow.. but your work makes me want to add more actions .. but too many projects right now as it is.  
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 PauloniusTopic starter

  • Elite
  • *
  • *
  • Posts: 2040
  • Activity:
    0%
  • Reputation Power: 29
  • Paulonius is on the verge of being accepted.Paulonius is on the verge of being accepted.Paulonius is on the verge of being accepted.Paulonius is on the verge of being accepted.Paulonius is on the verge of being accepted.
  • Respect: +162
  • Referrals: 1
    • View Profile
Re: Looking for a tutorial on creating data files
« Reply #20 on: November 27, 2012, 09:09:34 AM »
0
I will take a look!!
This coin declares Caesar is "Dictator for Life." He did serve as Dictator for the remainder of his life, but his life would end only a few weeks after this issue. For Caesar to put his image on coins and essentially declare himself king was too much for Brutus and his republican allies.

"If everything seems under control, you're not going fast enough'
-Mario Andretti

"If everyone is thinking alike, someone isn't thinking."
- General George Patton Jr

Tags: