SC Arguments: [Name:SC_ACTION Type:uint64 Value:'1' Name:SC_CODE Type:string Value:' //Copyright (c) 2024, dero1qyfyqe9v72xaha3dgz0m7qxa0vyru3g9vc9vwagtdpluewmv0mx26qqsavvj9. All rights reserved. Licence scid: e0ca740d8df8a4c30be9c32e32fddf797a383042f6ddc87f636343711fcbe8e5
//Parts of the InitializePrivate() & Update() code are Copyright (c) 2022, Civilware. All rights reserved. Licence scid: e973273da5efbdd852ee5a0535e28c45d49f0bff7e9ce4d00544b5d95015bd89
0
Function InitializePrivate() Uint64
10 IF EXISTS("owner") THEN GOTO 999
20 STORE("owner", SIGNER())
30 STORE("manager", ADDRESS_RAW("dero1qy0ydkcwuf7nvh6938jpalt5snsj2atgmdyms67rd05whuy8a2hvzqg46gh5f"))
40 STORE("decimals", 0)
50 STORE("00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", 1)
330 STORE("nameHdr", "Duelist Selection")
340 STORE("descrHdr", "Dero Desperado Duelist Selection")
360 STORE("iconURLHdr", "https://i.ibb.co/9TNPwQm/duelists.png")
370 STORE("tagsHdr", "#DERO #DESPERADO #DUEL")
900 RETURN 0
999 RETURN 1
End Function
Function Duelist_selection(how_many_players Uint64, player1 String, player2 String, player3 String, player4 String, player5 String, player6 String, player7 String, player8 String) Uint64
5 IF LOAD("manager") == SIGNER() THEN GOTO 10 ELSE GOTO 6
6 IF LOAD("owner") == SIGNER() THEN GOTO 10 ELSE GOTO 999
10 DIM rand, i, count_players as Uint64
20 DIM current_duelist, rand_player as String
25 LET count_players = how_many_players / 100000
26 IF count_players == 0 THEN GOTO 999 ELSE GOTO 30
30 STORE("count_players", count_players)
40 LET i = 0
50 LET i = i + 1
60 LET current_duelist = "DUELIST" + ITOA(i)
70 LET rand = RANDOM(count_players) + 1
75 IF EXISTS("rand" + rand) THEN GOTO 70
80 IF rand == 1 THEN GOTO 81 ELSE GOTO 85
81 LET rand_player = player1
82 GOTO 140
85 IF rand == 2 THEN GOTO 86 ELSE GOTO 90
86 LET rand_player = player2
87 GOTO 140
90 IF rand == 3 THEN GOTO 91 ELSE GOTO 95
91 LET rand_player = player3
92 GOTO 140
95 IF rand == 4 THEN GOTO 96 ELSE GOTO 100
96 LET rand_player = player4
97 GOTO 140
100 IF rand == 5 THEN GOTO 101 ELSE GOTO 105
101 LET rand_player = player5
102 GOTO 140
105 IF rand == 6 THEN GOTO 106 ELSE GOTO 110
106 LET rand_player = player6
107 GOTO 140
110 IF rand == 7 THEN GOTO 111 ELSE GOTO 115
111 LET rand_player = player7
112 GOTO 140
115 IF rand == 8 THEN GOTO 116 ELSE GOTO 200
116 LET rand_player = player8
117 GOTO 140
140 IF rand_player == "" THEN GOTO 999
141 STORE(current_duelist, current_duelist + "🤠: " + rand_player)
142 STORE(current_duelist + "🤠: " + rand_player, 1)
143 STORE("rand" + rand, 1)
200 IF i < count_players THEN GOTO 50
800 RETURN 0
999 RETURN 1
End Function
Function Remove_all() Uint64
5 IF LOAD("manager") == SIGNER() THEN GOTO 10 ELSE GOTO 6
6 IF LOAD("owner") == SIGNER() THEN GOTO 10 ELSE GOTO 999
10 DIM i, count_players as Uint64
20 DIM current_duelist as String
30 LET count_players = LOAD("count_players")
40 LET i = 0
50 LET i = i + 1
60 LET current_duelist = "DUELIST" + ITOA(i)
70 DELETE(LOAD(current_duelist))
80 DELETE(current_duelist)
90 DELETE("rand" + ITOA(i))
200 IF i < count_players THEN GOTO 50
800 RETURN 0
999 RETURN 1
End Function
Function Update(iconURL String, coverURL String, fileURL String, fileSignURL String, tags String, nameHdr String, descrHdr String, varname String, input String, withdrawal_fee Uint64) Uint64
5 IF LOAD("manager") == SIGNER() THEN GOTO 40 ELSE GOTO 6
6 IF LOAD("owner") == SIGNER() THEN GOTO 40 ELSE GOTO 999
40 IF iconURL != "" THEN GOTO 50 ELSE GOTO 60
50 STORE("iconURLHdr", iconURL)
60 IF coverURL != "" THEN GOTO 70 ELSE GOTO 80
70 STORE("coverURL", coverURL)
80 IF fileURL != "" THEN GOTO 90 ELSE GOTO 100
90 STORE("fileURL", fileURL)
100 IF fileSignURL != "" THEN GOTO 110 ELSE GOTO 120
110 STORE("fileSignURL", fileSignURL)
120 IF tags != "" THEN GOTO 130 ELSE GOTO 131
130 STORE("tagsHdr", tags)
131 IF nameHdr != "" THEN GOTO 132 ELSE GOTO 133
132 STORE("nameHdr", nameHdr)
133 IF descrHdr != "" THEN GOTO 134 ELSE GOTO 180
134 STORE("descrHdr", descrHdr)
180 RETURN 0
999 RETURN 1
End Function
Function UpdateCode(code String) Uint64 /// Update SC
10 IF LOAD("owner") == SIGNER() THEN GOTO 30
20 RETURN 1
30 UPDATE_SC_CODE(code)
40 RETURN 0
End Function
'] |