• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Converter 1.0

This bundle is marked as useful / simple. Simplicity is bliss, low effort and/or may contain minor bugs.
Convert string into the symbol and vice versa.

QWERTYUIOPASDFGHJKLZXCVBNMqwertyuiopasdfghjklzxcvbnm1234567890!@#$%^&*()_\=/




[trigger=Converter Book]
Converter Book
Events
Time - Elapsed game time is 0.01 seconds
Conditions
Actions
-------- Alphabet --------
Set C_Alphabet[1] = Q
Set C_Alphabet[2] = W
Set C_Alphabet[3] = E
Set C_Alphabet[4] = R
Set C_Alphabet[5] = T
Set C_Alphabet[6] = Y
Set C_Alphabet[7] = U
Set C_Alphabet[8] = I
Set C_Alphabet[9] = O
Set C_Alphabet[10] = P
Set C_Alphabet[11] = A
Set C_Alphabet[12] = S
Set C_Alphabet[13] = D
Set C_Alphabet[14] = F
Set C_Alphabet[15] = G
Set C_Alphabet[16] = H
Set C_Alphabet[17] = J
Set C_Alphabet[18] = K
Set C_Alphabet[19] = L
Set C_Alphabet[20] = Z
Set C_Alphabet[21] = X
Set C_Alphabet[22] = C
Set C_Alphabet[23] = V
Set C_Alphabet[24] = B
Set C_Alphabet[25] = N
Set C_Alphabet[26] = M
Set C_Alphabet[27] = q
Set C_Alphabet[28] = w
Set C_Alphabet[29] = e
Set C_Alphabet[30] = r
Set C_Alphabet[31] = t
Set C_Alphabet[32] = y
Set C_Alphabet[33] = u
Set C_Alphabet[34] = i
Set C_Alphabet[35] = o
Set C_Alphabet[36] = p
Set C_Alphabet[37] = a
Set C_Alphabet[39] = s
Set C_Alphabet[40] = d
Set C_Alphabet[41] = f
Set C_Alphabet[42] = g
Set C_Alphabet[42] = h
Set C_Alphabet[43] = j
Set C_Alphabet[44] = k
Set C_Alphabet[45] = l
Set C_Alphabet[46] = z
Set C_Alphabet[47] = x
Set C_Alphabet[48] = c
Set C_Alphabet[49] = v
Set C_Alphabet[50] = b
Set C_Alphabet[51] = n
Set C_Alphabet[52] = m
-------- Symbols --------
Set C_Symbol[1] = 1
Set C_Symbol[2] = 2
Set C_Symbol[3] = 3
Set C_Symbol[4] = 4
Set C_Symbol[5] = 5
Set C_Symbol[6] = 6
Set C_Symbol[7] = 7
Set C_Symbol[8] = 8
Set C_Symbol[9] = 9
Set C_Symbol[10] = !
Set C_Symbol[11] = @
Set C_Symbol[12] = #
Set C_Symbol[13] = %
Set C_Symbol[14] = ^
Set C_Symbol[15] = &
Set C_Symbol[16] = *
Set C_Symbol[17] = (
Set C_Symbol[18] = )
Set C_Symbol[19] = -
Set C_Symbol[20] = _
Set C_Symbol[21] = =
Set C_Symbol[22] = +
Set C_Symbol[23] = ~
Set C_Symbol[24] = /
Set C_Symbol[25] = \
Set C_Symbol[26] = ?[/trigger]


[trigger=Converter To Symbols]
Converter To Symbols
Events
Player - Player 1 (Red) types a chat message containing -ts as A substring
Player - Player 2 (Blue) types a chat message containing -ts as A substring
Player - Player 3 (Teal) types a chat message containing -ts as A substring
Player - Player 4 (Purple) types a chat message containing -ts as A substring
Player - Player 5 (Yellow) types a chat message containing -ts as A substring
Player - Player 6 (Orange) types a chat message containing -ts as A substring
Player - Player 7 (Green) types a chat message containing -ts as A substring
Player - Player 8 (Pink) types a chat message containing -ts as A substring
Player - Player 9 (Gray) types a chat message containing -ts as A substring
Player - Player 10 (Light Blue) types a chat message containing -ts as A substring
Player - Player 11 (Dark Green) types a chat message containing -ts as A substring
Player - Player 12 (Brown) types a chat message containing -ts as A substring
Conditions
Actions
Set C_String = (Substring((Entered chat string), 4, (Length of (Entered chat string))))
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 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 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 C_Integer[(Player number of (Triggering player))] = <Empty String>[/trigger]


[trigger=Converter To String]

ConverterToString
Events
Player - Player 1 (Red) types a chat message containing -tt as A substring
Player - Player 2 (Blue) types a chat message containing -tt as A substring
Player - Player 3 (Teal) types a chat message containing -tt as A substring
Player - Player 4 (Purple) types a chat message containing -tt as A substring
Player - Player 5 (Yellow) types a chat message containing -tt as A substring
Player - Player 6 (Orange) types a chat message containing -tt as A substring
Player - Player 7 (Green) types a chat message containing -tt as A substring
Player - Player 8 (Pink) types a chat message containing -tt as A substring
Player - Player 9 (Gray) types a chat message containing -tt as A substring
Player - Player 10 (Light Blue) types a chat message containing -tt as A substring
Player - Player 11 (Dark Green) types a chat message containing -tt as A substring
Player - Player 12 (Brown) types a chat message containing -tt as A substring
Conditions
Actions
Set C_String = (Substring((Entered chat string), 4, (Length of (Entered chat string))))
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 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 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 C_Integer[(Player number of (Triggering player))] = <Empty String>[/trigger]




1.0 - first upload



Keywords:
Convert, protect, pasword, OxygenD, code, symbol, string, strings. symbols, system, into.
Contents

Converter 1.0 (Map)

Reviews
19th Jul 2011 Bribe: All of these game messages you use, leak the player group: Game - Display to (Player group((Triggering player))) "i" should not be an array because you only reference index 1 and 2, so you wasted an array. Why would...

Moderator

M

Moderator

19th Jul 2011
Bribe:

All of these game messages you use, leak the player group:

Game - Display to (Player group((Triggering player)))

"i" should not be an array because you only reference index 1 and 2,
so you wasted an array.

Why would someone ever use this?

It also needs an in-game screenshot.

I'm going to reject this.
 
yeah and also maybe post some of your code as example in case people dont feel like opening the map or is unable too at the time.

Actually, he MUST post the code because anyone who's been here too long WILL NEVER open the map xD (Except the mods :p)
I usually make a few exceptions and open it up :p (If I'm curious)
 
Level 31
Joined
Jul 10, 2007
Messages
6,306
And again, this one doesn't even do the conversions that well.. it should never be used for save/load.. >.<


The BigInt thread shows how to properly combine numbers together : |.


That's why I said this is a pretty useless library and can't even compete against BigInt


Knowing how to use a save/load system or not, this one still does the conversions completely wrong.


And note that changing the base of a number is very easy... the base property does it >.<

JASS:
struct tester extends array
    private static method save takes nothing returns string
        local Base encryptKey = Base["0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"]
        local BigInt int = BigInt.create(encryptKey)
        local string s
        
        //storing values of
        //501 out of a max of 1000000 (gold) (d1)
        //1938 out of a max of 1000000 (d2)
        //5821 out of a max of 28392 (super powers) (d3)
        //1 out of a max of 1 (bool) (d4)
        //0 out of a max of 1 (bool) (d5)
        //11 out of a max of 11 (player id?) (d6)
        //19 out of a max of 1000 (unit level) (d7)
        //12 out of a max of 16 (flags) (d8)

        call int.add(501,0) //encode 501 (max doesn't matter, put biggest value here)

        call int.multiply(1000000+1)
        call int.add(1938,0) //encode 1938

        call int.multiply(28392+1)
        call int.add(5821,0) //encode 5821

        call int.multiply(1+1)
        call int.add(1,0) //encode 1

        call int.multiply(1+1)
        call int.add(0,0) //encode 0

        call int.multiply(11+1)
        call int.add(11,0) //encode 11

        call int.multiply(1000+1)
        call int.add(19,0) //encode 19

        call int.multiply(16+1)
        call int.add(12,0) //encode 12
        
        set s = int.toString()
        call int.destroy()

        //display the code ^_^
        return s
    endmethod
    
    private static method load takes string s returns nothing
        local Base encryptKey = Base["0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"]
        local string loadCode = s
        local BigInt int = BigInt.convertString(loadCode, encryptKey)
        
        local integer d8 = int.divide(16+1) //12
        local integer d7 = int.divide(1000+1) //19
        local integer d6 = int.divide(11+1) //11
        local integer d5 = int.divide(1+1) //0
        local integer d4 = int.divide(1+1) //1
        local integer d3 = int.divide(28392+1) //5821
        local integer d2 = int.divide(1000000+1) //1938
        local integer d1 = int.toInt() //501
        
        call int.destroy()
        
        call DisplayTimedTextToPlayer(GetLocalPlayer(), 0, 0, 60, "d1: " + I2S(d1) + "==" + "501")
        call DisplayTimedTextToPlayer(GetLocalPlayer(), 0, 0, 60, "d2: " + I2S(d2) + "==" + "1938")
        call DisplayTimedTextToPlayer(GetLocalPlayer(), 0, 0, 60, "d3: " + I2S(d3) + "==" + "5821")
        call DisplayTimedTextToPlayer(GetLocalPlayer(), 0, 0, 60, "d4: " + I2S(d4) + "==" + "1")
        call DisplayTimedTextToPlayer(GetLocalPlayer(), 0, 0, 60, "d5: " + I2S(d5) + "==" + "0")
        call DisplayTimedTextToPlayer(GetLocalPlayer(), 0, 0, 60, "d6: " + I2S(d6) + "==" + "11")
        call DisplayTimedTextToPlayer(GetLocalPlayer(), 0, 0, 60, "d7: " + I2S(d7) + "==" + "19")
        call DisplayTimedTextToPlayer(GetLocalPlayer(), 0, 0, 60, "d8: " + I2S(d8) + "==" + "12")
    endmethod
    
    private static method onInit takes nothing returns nothing
        local string s = save()
        call DisplayTimedTextToPlayer(GetLocalPlayer(), 0, 0, 60, "2G9Z2EVGV87IY\n" + s)
        call load(s)
    endmethod
endstruct



Your converter thing is never going to be able to compete with BigInt... it has less power and it has bad output >.>


Leave conversions to BigInt


BigInt can work with numbers as big as 8191 digits long.
 
Top