Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
You are using an out of date browser. It may not display this or other websites correctly. You should upgrade or use an alternative browser.
Triggers
Converter 1.0.w3x
Variables
Untitled Category
Dont copy this
Converter
Converter Book
ConverterToSymbols
ConverterToString
InNextVersion 2.0
GetString
Head Code
IN VERSION 2.0!!!
//TESH.scrollpos=0
//TESH.alwaysfold=0
Name
Type
is_array
initial_value
C_Alphabet
string
Yes
C_Integer
string
Yes
C_String
string
No
C_StringLength
integer
No
C_Symbol
string
Yes
i
integer
Yes
Dont copy this
Events
Time - Elapsed game time is 1.00 seconds
Conditions
Actions
Custom script: call DisplayTimedTextToPlayer(Player(0), 0, 0, bj_TEXT_DELAY_QUEST, "Enter |cFFFF0000-tt|r to сonvert you symbols into the string. Enter |cFFFF0000-ts|r to convert you string into the symbols. ")
Player - Player 1 (Red) types a chat message containing -ts (Unexpected type: 'stringnoformat') as A substring
Player - Player 2 (Blue) types a chat message containing -ts (Unexpected type: 'stringnoformat') as A substring
Player - Player 3 (Teal) types a chat message containing -ts (Unexpected type: 'stringnoformat') as A substring
Player - Player 4 (Purple) types a chat message containing -ts (Unexpected type: 'stringnoformat') as A substring
Player - Player 5 (Yellow) types a chat message containing -ts (Unexpected type: 'stringnoformat') as A substring
Player - Player 6 (Orange) types a chat message containing -ts (Unexpected type: 'stringnoformat') as A substring
Player - Player 7 (Green) types a chat message containing -ts (Unexpected type: 'stringnoformat') as A substring
Player - Player 8 (Pink) types a chat message containing -ts (Unexpected type: 'stringnoformat') as A substring
Player - Player 9 (Gray) types a chat message containing -ts (Unexpected type: 'stringnoformat') as A substring
Player - Player 10 (Light Blue) types a chat message containing -ts (Unexpected type: 'stringnoformat') as A substring
Player - Player 11 (Dark Green) types a chat message containing -ts (Unexpected type: 'stringnoformat') as A substring
Player - Player 12 (Brown) types a chat message containing -ts (Unexpected type: 'stringnoformat') as A substring
Conditions
Actions
Set Variable Set C_String = (Substring((Entered chat string), 4, (Length of (Entered chat string))))
Set Variable Set C_StringLength = (Length of C_String)
Game - Display to (Player group((Triggering player))) for 6.00 seconds the text: (|cFFFFFF00You enter|r - + (|cFFC00000 + (C_String + |r)))
For each (Integer i[1] ) from 1 to C_StringLength , do (Actions)
Loop - Actions
For each (Integer i[2] ) from 1 to 52 , do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
i[2] Greater than or equal to 27
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Substring(C_String, i[1], i[1])) Equal to C_Alphabet[i[2]]
Then - Actions
Set Variable Set C_Integer[(Player number of (Triggering player))] = (C_Integer[(Player number of (Triggering player))] + C_Symbol[(i[2] - 26)])
Else - Actions
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Substring(C_String, i[1], i[1])) Equal to C_Alphabet[i[2]]
Then - Actions
Set Variable Set C_Integer[(Player number of (Triggering player))] = (C_Integer[(Player number of (Triggering player))] + C_Symbol[i[2]])
Else - Actions
Game - Display to (Player group((Triggering player))) for 6.00 seconds the text: (|cFFFFFF00You get|r - + (|cFFC00000 + (C_Integer[(Player number of (Triggering player))] + |r)))
Set Variable Set C_Integer[(Player number of (Triggering player))] = ""
Convert you symbols into the string.
ConverterToString
Events
Player - Player 1 (Red) types a chat message containing -tt (Unexpected type: 'stringnoformat') as A substring
Player - Player 2 (Blue) types a chat message containing -tt (Unexpected type: 'stringnoformat') as A substring
Player - Player 3 (Teal) types a chat message containing -tt (Unexpected type: 'stringnoformat') as A substring
Player - Player 4 (Purple) types a chat message containing -tt (Unexpected type: 'stringnoformat') as A substring
Player - Player 5 (Yellow) types a chat message containing -tt (Unexpected type: 'stringnoformat') as A substring
Player - Player 6 (Orange) types a chat message containing -tt (Unexpected type: 'stringnoformat') as A substring
Player - Player 7 (Green) types a chat message containing -tt (Unexpected type: 'stringnoformat') as A substring
Player - Player 8 (Pink) types a chat message containing -tt (Unexpected type: 'stringnoformat') as A substring
Player - Player 9 (Gray) types a chat message containing -tt (Unexpected type: 'stringnoformat') as A substring
Player - Player 10 (Light Blue) types a chat message containing -tt (Unexpected type: 'stringnoformat') as A substring
Player - Player 11 (Dark Green) types a chat message containing -tt (Unexpected type: 'stringnoformat') as A substring
Player - Player 12 (Brown) types a chat message containing -tt (Unexpected type: 'stringnoformat') as A substring
Conditions
Actions
Set Variable Set C_String = (Substring((Entered chat string), 4, (Length of (Entered chat string))))
Set Variable Set C_StringLength = (Length of C_String)
Game - Display to (Player group((Triggering player))) for 6.00 seconds the text: (|cFFFFFF00You enter|r - + (|cFFC00000 + (C_String + |r)))
For each (Integer i[1] ) from 1 to C_StringLength , do (Actions)
Loop - Actions
For each (Integer i[2] ) from 1 to 52 , do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
i[2] Greater than or equal to 27
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Substring(C_String, i[1], i[1])) Equal to C_Symbol[i[2]]
Then - Actions
Set Variable Set C_Integer[(Player number of (Triggering player))] = (C_Integer[(Player number of (Triggering player))] + C_Alphabet[(i[2] + 26)])
Else - Actions
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Substring(C_String, i[1], i[1])) Equal to C_Symbol[i[2]]
Then - Actions
Set Variable Set C_Integer[(Player number of (Triggering player))] = (C_Integer[(Player number of (Triggering player))] + C_Alphabet[i[2]])
Else - Actions
Game - Display to (Player group((Triggering player))) for 6.00 seconds the text: (|cFFFFFF00You get|r - + (|cFFC00000 + (C_Integer[(Player number of (Triggering player))] + |r)))
Set Variable Set C_Integer[(Player number of (Triggering player))] = ""
New system, will work in version 2.0.
GetString
Events
Player - Player 1 (Red) types a chat message containing (Unexpected type: 'stringnoformat') as A substring
Player - Player 2 (Blue) types a chat message containing (Unexpected type: 'stringnoformat') as A substring
Player - Player 3 (Teal) types a chat message containing (Unexpected type: 'stringnoformat') as A substring
Player - Player 4 (Purple) types a chat message containing (Unexpected type: 'stringnoformat') as A substring
Player - Player 5 (Yellow) types a chat message containing (Unexpected type: 'stringnoformat') as A substring
Player - Player 6 (Orange) types a chat message containing (Unexpected type: 'stringnoformat') as A substring
Player - Player 7 (Green) types a chat message containing (Unexpected type: 'stringnoformat') as A substring
Player - Player 8 (Pink) types a chat message containing (Unexpected type: 'stringnoformat') as A substring
Player - Player 9 (Gray) types a chat message containing (Unexpected type: 'stringnoformat') as A substring
Player - Player 10 (Light Blue) types a chat message containing (Unexpected type: 'stringnoformat') as A substring
Player - Player 11 (Dark Green) types a chat message containing (Unexpected type: 'stringnoformat') as A substring
Player - Player 12 (Brown) types a chat message containing (Unexpected type: 'stringnoformat') as A substring
Conditions
Actions
Set Variable Set C_String = (Entered chat string)
Game - Display to (Player group((Triggering player))) the text: (|cFFFFFF00You enter|r - + (|cFFFF0000 + (C_String + |r)))
Set Variable Set C_StringLength = (Length of C_String)
Game - Display to (Player group((Triggering player))) the text: (|cFFFFFF00You get|r - + (|cFFFF0000 + (C_Integer[(Player number of (Triggering player))] + |r)))
function convert takes string s, integer L, integer id returns string
local integer i
local integer ii
set i = 1
loop
exitwhen i > L
set ii = 1
loop
exitwhen ii > 52
if SubString(s, i, i) == udg_C_Alphabet[ii] then
if ii >= 27 then
set udg_C_Integer[id] = ( udg_C_Integer[id] + udg_C_Number[( ii - 26 )] )
else
endif
else
if SubString(s, i, i) == udg_C_Alphabet[ii] then
set udg_C_Integer[id] = ( udg_C_Integer[id] + udg_C_Number[ii] )
else
endif
endif
set ii = ii + 1
endloop
set i = i + 1
endloop
endfunction
///////////////////////////////////////////////////////
/// ///
/// THIS CODE IS NOT WORKING NOW!! ///
/// It's just sketch! ///
/////////////////////////////////////////////////////
In version 2.0
1. Reworked to Jass
2. Easier to use
3. All in head of map
4. Protection will be stronger.
How to import?
1.Just copy folder "Converter" into you map and by happy:)
2. Write my nick in helper list.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.