Difference between revisions of "DeleteJournal"

From Wiki
Jump to: navigation, search
 
Line 1: Line 1:
__NOTOC__
+
{{command header|obsolete}}
== DeleteJournal ==
+
{{body|contPos {X-Coordinate} {Y-Coordinate}|deleteJournal is considered obsolete and is only kept for backwards compatibility.
'''Client'''
+
=== Synopsis ===
+
contPos {X-Coordinate} {Y-Coordinate}
+
 
+
 
+
=== Description ===
+
As of Build 0084 deleteJournal is to be considered obsolete and is only kept for backwards compatibility.
+
  
 
The deleteJournal command forgets the contents of the journal from the last read line (inclusive) and everything above so that it cannot be found using scanJournal.  
 
The deleteJournal command forgets the contents of the journal from the last read line (inclusive) and everything above so that it cannot be found using scanJournal.  
Line 15: Line 8:
 
Imagine you manage to say "Hail" three times in a very short time. The example script finds the first "Hail" on line 3, says "Farewell" and forgets line 3 and everything above (because line 3 was the last line read by scanJournal). As the For loop proceeds it will find the other two "Hails" and react as intended.
 
Imagine you manage to say "Hail" three times in a very short time. The example script finds the first "Hail" on line 3, says "Farewell" and forgets line 3 and everything above (because line 3 was the last line read by scanJournal). As the For loop proceeds it will find the other two "Hails" and react as intended.
  
The very perceptive reader might be asking himself/herself why you cannot just specify the line number as a parameter of deleteJournal. To answer that question, imagine that the journal gets two new entries right when script execution is between scanJournal and deleteJournal. So when the script recognizes the first "Hail" on line 3 and says the "Farewell", line 1 and 2 get moved up by two lines (because of those two new journal entries) and are now on line 3 and 4 which would then be ignored by "deleteJournal 3". That is why deleteJournal determines itself which line is to be ignored.
+
The very perceptive reader might be asking himself/herself why you cannot just specify the line number as a parameter of deleteJournal. To answer that question, imagine that the journal gets two new entries right when script execution is between scanJournal and deleteJournal. So when the script recognizes the first "Hail" on line 3 and says the "Farewell", line 1 and 2 get moved up by two lines (because of those two new journal entries) and are now on line 3 and 4 which would then be ignored by "deleteJournal 3". That is why deleteJournal determines itself which line is to be ignored.}}
 
+
  
 
==== Example ====
 
==== Example ====
Line 31: Line 23:
 
</pre>
 
</pre>
  
 
+
{{footer}}
==== See Also ====
+
{|
+
| Width=200px | [[ScanJournal]] || Width=200px | [[Var_journal|&#0035;Journal]] || width=200px | [[Var_jIndex|&#0035;Jindex]] || Width=200px | [[var_jColor|&#0035;Jcolor]]
+
|}
+
----
+
{|
+
| Width=200px | [[Main_Page]] || Width=200px | [[Documentation]] || Width=200px |
+
[[Documentation#Client |Client ]]
+
|}
+

Revision as of 11:16, 27 August 2005

Synopsis

contPos {X-Coordinate} {Y-Coordinate}

Description

deleteJournal is considered obsolete and is only kept for backwards compatibility.

The deleteJournal command forgets the contents of the journal from the last read line (inclusive) and everything above so that it cannot be found using scanJournal.

Here is how the example works: Since it happens quite often that several entries get written into the journal between two checks you should scan more than just the first line of the journal. 10 lines is a very good value to make sure you don't miss any new journal text. You must use deleteJournal to mark the text you have already processed so that it does not get interpreted multiple times.

Imagine you manage to say "Hail" three times in a very short time. The example script finds the first "Hail" on line 3, says "Farewell" and forgets line 3 and everything above (because line 3 was the last line read by scanJournal). As the For loop proceeds it will find the other two "Hails" and react as intended.

The very perceptive reader might be asking himself/herself why you cannot just specify the line number as a parameter of deleteJournal. To answer that question, imagine that the journal gets two new entries right when script execution is between scanJournal and deleteJournal. So when the script recognizes the first "Hail" on line 3 and says the "Farewell", line 1 and 2 get moved up by two lines (because of those two new journal entries) and are now on line 3 and 4 which would then be ignored by "deleteJournal 3". That is why deleteJournal determines itself which line is to be ignored.

Example

for %i 10 1
{
 scanJournal %i
 if hail in #journal
 {
   msg Farewell$
   deleteJournal
 }
}

See also

Main Page Documentation