Author Topic: (Retired) ENs - Subs - FlatFile Tables (Emulator)  (Read 5126 times)

0 Members and 1 Guest are viewing this topic.

Offline Endless NightTopic starter

  • 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
(Retired) ENs - Subs - FlatFile Tables (Emulator)
« on: May 12, 2011, 05:18:10 AM »
0
ENs - FlatFile Tables
Emulator - being as EUO has no way to load and parse files so can only emulate database functions.

Debuggin this code gave me a serious migraine... but is dang useful. Use it as a called script, Set the path in %EN_Table

TABLE COMMANDS
set %EN_Table C:\easyuo/EUO , #spc , Scripts\ENs-Scripts\ENs-Subs-Tables.Txt
call %EN_Table EN_Table_Create       ; %1=TableName , %2...%z Field Names
;                                        ; Creates table and sets active table.
call %EN_Table EN_Table_Use          ; %1=TableName (Sets active Table)
call %EN_Table EN_Table_Goto         ; %1=RecordNum %2=Optional TableName  - sets fields
call %EN_Table EN_Table_Next         ; %1=Optional TableName  - sets fields
call %EN_Table EN_Table_Prior        ; %1=Optional TableName  - sets fields
call %EN_Table EN_Table_Top          ; %1=Optional TableName  - sets fields
call %EN_Table EN_Table_Bottom       ; %1=Optional TableName  - sets fields
call %EN_Table EN_Table_isDeteled    ; %1=Optional TableName  - Returns #true/#false
call %EN_Table EN_Table_Detele       ; %1=Optional TableName  - Sets Deleted Flag
call %EN_Table EN_Table_Recall       ; %1=Optional TableName  - Undeletes Record
call %EN_Table EN_Table_Append       ; Adds record to end of table *1
call %EN_Table EN_Table_Insert       ; Inserts Record at position EN_RecordOn *1
call %EN_Table EN_Table_Update       ; Updates Current Record *1
;                                       *1 (Uses %EN_TableOn, EN_RecordOn)
call EN_Table_Load   ;notdone yet
call EN_Table_Save  ; notdone yet

EXPOSED VARIABLES
%EN_TableOn  %EN_RecordOn
%TableName_  RecordCnt, FieldCnt, RecordOn, Deleted , Prior , Next , Top , Bottom
%TableName_  Fieldsnames...1...z   (as defined on the table create command)


All the normal bs ENs disclaimers apply...

REMEMBER: Feedback is important... good bad or not comment all important if you download give feedback

(C) 2007 All Rights Reserved JosephAJ
Commercial usage requires written permission from the author


NOTE: My scripts or any derivative of them are *not* for use in other players script/s!

There are 2 attachment(s) in this post. You must register and post an acceptable introduction to download
ENs-Subs-Tables-Example Usage.txt
ENs-Subs-Tables.txt
« Last Edit: November 27, 2012, 05:26:37 PM by Endless Night »
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 Endless NightTopic starter

  • 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: ENs - FlatFile Tables (Emulator)
« Reply #1 on: May 12, 2011, 05:20:33 AM »
0
Example Code
Create a table of items equipped on paperdoll. Scroll throw table displaying the information stored.

Code: [Select]
; Initialize Pathing and Create the table
set #lpc 9000
set %EN_Table C:\easyuo/EUO , #spc , Scripts\ENs-Scripts\ENs-Subs-Tables.Txt
call %EN_Table EN_Table_Create Equipped id Property Color    ; Create table

Code: [Select]
; populate table with equipment worn information
finditem * C_, #charid   
if #findcnt > 0
  {
  set !s #scnt
  for #findindex 1 #findcnt
    {
    event property #findid
    ; Method 1
    Call %EN_Table EN_Table_Append #findid #property #findcol
    ; Method 2
;    set %Equipped_id        #findid
;    set %Equipped_Property  #property
;    set %Equipped_Color     #findcol
;    Call %EN_Table EN_Table_Append
    }
    set !t #scnt - !s
    display ok Saved %Equipped_RecordCnt Records in !t seconds
  }

Code: [Select]
display ok  Scrolling  Thu Table By Record Number $$
for !RecNo 1 %Equipped_RecordCnt
  {
  CAll %EN_Table EN_Table_Goto !RecNo
  display ok TableOn: %EN_TableOn  RecordOn: %Equipped_RecordOn Deleted: %Equipped_Deleted $ $ ID= %Equipped_ID Property= %Equipped_Property  $$ %Equipped_RecordOn : prior= %Equipped_Prior Next= %Equipped_Next    ; at bottom
  }

Code: [Select]
display ok  Scrolling Thu Table via TOP Next
call %EN_Table EN_Table_Top
repeat
  display ok TableOn: %EN_TableOn  RecordOn: %Equipped_RecordOn Deleted: %Equipped_Deleted $ $ ID= %Equipped_ID Property= %Equipped_Property  $$ %Equipped_RecordOn : prior= %Equipped_Prior Next= %Equipped_Next    ; at bottom
  call %EN_Table EN_Table_Next
Until #result = #false   ; at bottom

Code: [Select]
display ok Scroll Thu Table Backwards via Bottom Prior
call %EN_Table EN_Table_Bottom
repeat
  display ok TableOn: %EN_TableOn  RecordOn: %Equipped_RecordOn Deleted: %Equipped_Deleted $ $ ID= %Equipped_ID Property= %Equipped_Property  $$ %Equipped_RecordOn : prior= %Equipped_Prior Next= %Equipped_Next    ; at bottom
  call %EN_Table EN_Table_Prior
Until #result = #false   ; at bottom
« Last Edit: May 12, 2011, 01:10:51 PM by Endless Night »
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 Endless NightTopic starter

  • 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: ENs - FlatFile Tables (Emulator)
« Reply #2 on: May 12, 2011, 05:41:23 AM »
0
Example Code 2
Relationships and filters.   Experimental .. code not yet implemented.


Code: [Select]
; Create tables and assign Data.

call EN_Table Create Food        Catagory Discription       ; Create table 'Food' with 2 fields
call EN_Table Create FoodTypes   Catagory Name    

call EN_Table Use Food   ; set active table
call EN_Table Add Cheese Cheese

call EN_Table Use FoodTypes   ; set active table
call EN_Table Add %Food_Catagory Provolone
call EN_Table Add %Food_Catagory Swiss
call EN_Table Add %Food_Catagory Cheddar
call EN_Table Add %Food_Catagory Feta

call EN_Table Use Food   ; set active table
call EN_Table Add Milk  Milk
call EN_Table Use FoodTypes  
call EN_Table Add %Food_Catagory  Soy
call EN_Table Add %Food_Catagory  Haznut
call EN_Table Add %Food_Catagory  Non-Fat
call EN_Table Add %Food_Catagory  Low-Fat
call EN_Table Add %Food_Catagory  Whole

Code: [Select]
; Get a Subset of data by setting a filter from one table to another

call EN_Table Use FoodTypes   ; set active table
call EN_Table SetFilter  Catagory = %Food_Catagory




« Last Edit: May 12, 2011, 05:54:03 AM by Endless Night »
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 Endless NightTopic starter

  • 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: ENs - FlatFile Tables (Emulator)
« Reply #3 on: May 12, 2011, 01:12:09 PM »
0
If anyone is interested in this work let me know.  I will be using this to create my Action Template Tables.
« Last Edit: May 12, 2011, 04:14:18 PM by Endless Night »
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 Outlaw Josey Wales

  • Full Moon Rising!
  • Hero Member
  • *
  • Posts: 595
  • Activity:
    0%
  • Reputation Power: 7
  • Outlaw Josey Wales has no influence.
  • Gender: Male
  • Respect: +59
  • Referrals: 2
    • View Profile
Re: ENs - FlatFile Tables (Emulator)
« Reply #4 on: May 12, 2011, 07:09:40 PM »
0
hands 12 some tylenol along with a fifth of bourban

Offline Paulonius

  • 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: ENs - FlatFile Tables (Emulator)
« Reply #5 on: May 13, 2011, 02:40:57 PM »
0
I am going to take a look at these and figure out how to use them in the near future.  I am wondering whether a file like this could replace the craftinfo script.
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: