Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Scripting troubles


Derek
 Share

Recommended Posts

Sadscript has always pissed me off, because it doesn't make sense to me. I found a great script today, the rick rolling one. But I just can't get it to work. It's a /command, so I went to the /command section, and put the script in. It looked like all the other ones, but it still didn't work. (Yes I reloaded them). So could someone let me know how to put this script in correctly?

http://www.touchofdeathforums.com/smf/index.php/topic,42299.0.html
Link to comment
Share on other sites

Alright, it's got some useless poop in it though.
Come to think of it, the level up command never worked either. :/

' Executed whenever a slash command is sent to the server.
Sub Commands(Index)
Dim TextSay
Dim PlayerID
Dim MapNum

' Get the command and arguments from the cache.
TextSay = Trim(GetVar("Scripts\Command.ini", "TEMP", "Text" & Index))

' Split the command into an array. All arguments are seperated by spaces.
TextSay = Split(TextSay)

Select Case TextSay(0)
Case "/testscripts"
Call TestMain(Index)
Exit Sub

Case "/help"
Call PlayerMsg(Index, "Social Commands:", WHITE)
Call PlayerMsg(Index, "'msghere = Broadcast Message", WHITE)
Call PlayerMsg(Index, "-msghere = Emote Message", WHITE)
Call PlayerMsg(Index, "!namehere msghere = Player Message", WHITE)
Call PlayerMsg(Index, "Available Commands: /help, /info, /who, /fps, /inv, /stats, /train, /party, /join, /leave, /refresh", WHITE)
Exit Sub

Case "/calladmins"
If GetPlayerAccess(Index) = 0 Then
Call AdminMsg(GetPlayerName(Index) & " needs your help!", BRIGHTGREEN)
Else
Call PlayerMsg(Index, "You are an admin! You cannot call for help!", BRIGHTGREEN)
End If
Exit Sub

Case "/RollRick"
  color = Rand(0, 15)
        Call PlayerMsg(Index, "We're no strangers to love", color)
  color = Rand(0, 15)
        Call PlayerMsg(Index, "You know the rules and so do I", color)
  color = Rand(0, 15)
        Call PlayerMsg(Index, "A full commitment's what I'm thinking of", color)
  color = Rand(0, 15)
        Call PlayerMsg(Index, "You wouldn't get this from any other guy", color)
  color = Rand(0, 15)
        Call PlayerMsg(Index, " ", $color)
        Call PlayerMsg(Index, "I just wanna tell you how I'm feeling", color)
  color = Rand(0, 15)
        Call PlayerMsg(Index, "Gotta make you understand", color)
  color = Rand(0, 15)
        Call PlayerMsg(Index, " ", color)
        Call PlayerMsg(Index, "Never gonna give you up, never gonna let you down", color)
  color = Rand(0, 15)
        Call PlayerMsg(Index, "Never gonna run around and desert you", color)
  color = Rand(0, 15)
        Call PlayerMsg(Index, "Never gonna make you cry, never gonna say goodbye", color)
  color = Rand(0, 15)
        Call PlayerMsg(Index, "Never gonna tell a lie and hurt you", color)
  color = Rand(0, 15)
        Call PlayerMsg(Index, " ", color)
        Call PlayerMsg(Index, "We've known each other for so long", WHITE)
  color = Rand(0, 15)
        Call PlayerMsg(Index, "Your heart's been aching but you're too shy to say it", color)
  color = Rand(0, 15)
        Call PlayerMsg(Index, "Inside we both know what's been going on", color)
  color = Rand(0, 15)
        Call PlayerMsg(Index, "We know the game and we're gonna play it", color)
  color = Rand(0, 15)
        Call PlayerMsg(Index, " ", color)
        Call PlayerMsg(Index, "And if you ask me how I'm feeling", color)
  color = Rand(0, 15)
        Call PlayerMsg(Index, "Don't tell me you're too blind to see", color)
  color = Rand(0, 15)
        Call PlayerMsg(Index, "", color)
        Call PlayerMsg(Index, "Never gonna give you up, never gonna let you down", color)
  color = Rand(0, 15)
        Call PlayerMsg(Index, "Never gonna run around and desert you", color)
  color = Rand(0, 15)
        Call PlayerMsg(Index, "Never gonna make you cry, never gonna say goodbye", color)
  color = Rand(0, 15)
        Call PlayerMsg(Index, "Never gonna tell a lie and hurt you", color)
      Exit Sub

Case "/admin"
If GetPlayerAccess(Index) > 0 Then
Call PlayerMsg(Index, "Social Commands:", WHITE)
Call PlayerMsg(Index, """msghere = Global Admin Message", WHITE)
Call PlayerMsg(Index, "=msghere = Private Admin Message", WHITE)
Call PlayerMsg(Index, "Available Commands: /admin, /loc, /mapeditor, /warpmeto, /warptome, /warpto, /setsprite, /mapreport, /kick, /ban, /edititem, /respawn, /editnpc, /motd, /editshop, /ban, /editspell", WHITE)
End If
Exit Sub

Case "/warpmeto"
If GetPlayerAccess(Index) > 0 Then
PlayerID = FindPlayer(TextSay(1))

If PlayerID > 0 Then
Call PlayerWarp(Index, GetPlayerMap(PlayerID), GetPlayerX(PlayerID), GetPlayerY(PlayerID))
Call PlayerMsg(Index, "You have been warped to " & GetPlayerName(PlayerID) & ".", BROWN)
Else
Call PlayerMsg(Index, "Player is not online.", WHITE)
End If
End If
Exit Sub 

Case "/warptome"
If GetPlayerAccess(Index) > 0 Then
PlayerID = FindPlayer(TextSay(1))

If PlayerID > 0 Then
Call PlayerWarp(PlayerID, GetPlayerMap(Index), GetPlayerX(Index), GetPlayerY(Index))
Call PlayerMsg(PlayerID, "You have been warped to " & GetPlayerName(Index) & ".", BROWN)
Else
Call PlayerMsg(Index, "Player is not online.", WHITE)
End If
End If
Exit Sub         

Case "/levelup"
  If GetPlayerAccess(Index) > 0 Then
      PlayerID = FindPlayer(TextSay(2))
      level = TextSay(1)
      Call SetPlayerLevel(PlayerID, GetPlayerLevel(PlayerID) + level )
      Call SendPlayerData(PlayerID)
  End If

case "/setupshop"
inThere = GetVar("accounts\Shops\" & GetPlayerName(index) & ".ini", "shop", "InStep")

if inThere = 0 Then
exit sub
end if
if inThere = 1 Then
shophave = GetVar("accounts\Shops\" & GetPlayerName(index) & ".ini", "shop", "running")
if shophave = "" Then
Call PutVar("accounts\Shops\" & GetPlayerName(index) & ".ini", "shop", "running", 0)
call playermsg(Index, "Try again.", 12)
end if
if shophave = 1 Then
Call PlayerMsg(Index, "You already have a shop running!!", 12)
exit sub
end if
'call playermsg(Index, GetPlayerMap(index), 12)
Call PutVar("accounts\Shops\" & "setup.ini", "setup", GetPlayerX(index) & GetPlayerY(index) & GetPlayerMap(index) & "Taken", 1)
Call PutVar("accounts\Shops\" & "setup.ini", "setup", GetPlayerX(index) & GetPlayerY(index) & GetPlayerMap(index) & "name", GetPlayerName(index))
Call PutVar("accounts\Shops\" & GetPlayerName(index) & ".ini", "shop", "running", 1)
Call PlayerMsg(Index, "Shop is setup.", 12)
end if
exit sub

case "/closeshop"

tileGet = GetVar("accounts\Shops\" & "setup" & ".ini", "setup",  GetPlayerX(index) & GetPlayerY(index) & GetPlayerMap(index) & "Taken") 'taken or  not
tileGet2 = GetVar("accounts\Shops\" & "setup" & ".ini", "setup",  GetPlayerX(index) & GetPlayerY(index) & GetPlayerMap(index) & "name") 'name of the step in
getTile2 = GetVar("accounts\Shops\" & "setup" & ".ini", "setup",  GetPlayerX(index) & GetPlayerY(index) & GetPlayerMap(index) & "name") 'name of the step in
'call playermsg(index, tileGet, 12)

if tileGet = "" Then
Call PlayerMsg(Index, "This shop is not even opened!!", 12)
exit sub
end if

if tileGet = "0" Then
Call PlayerMsg(Index, "This shop is not even opened!!", 12)
exit sub
end if

If tileGet = 1 Then

If GetPlayerName(index) = tileGet2 Then

Call PlayerMsg(index, "You have closed your shop.", 12)
Call PutVar("accounts\Shops\" & "setup.ini", "setup", GetPlayerX(index) & GetPlayerY(index) & GetPlayerMap(index) & "Taken", 0)
Call PutVar("accounts\Shops\" & "setup.ini", "setup", GetPlayerX(index) & GetPlayerY(index) & GetPlayerMap(index) & "name", "none")
Call PutVar("accounts\Shops\" & GetPlayerName(index) & ".ini", "shop", "running", 0)
Call PutVar("accounts\Shops\" & GetPlayerName(index) & ".ini", "shop", "ismade", 0)
Call PutVar("accounts\Shops\" & GetPlayerName(index) & ".ini", "shop", "desc", "NONE")

    Do While c <= 24
Call PutVar("accounts\Shops\" & GetPlayerName(index) & ".ini", "shop", "slot" & c, 0)     
        C = C + 1
    Loop

              C = 1
    Do While c <= 25
Call PutVar("accounts\Shops\" & GetPlayerName(index) & ".ini", "shop", "slot" & c, 50)
Call PutVar("accounts\Shops\" & GetPlayerName(index) & ".ini", "shop", "slotvalue" & c, 0)
Call PutVar("accounts\Shops\" & GetPlayerName(index) & ".ini", "shop", "slotprice" & c, 0)   
        C = C + 1
    Loop
'exit sub
else
'call playermsg(Index, "not ur shop.", 12)

gaySs = 0
'HUGE SCRIPT ALERT
mySs = GetVar("accounts\Shops\" & getTile2 & ".ini", "shop", "slot" & 1)
if mySs = 50 Then
gaySs = gaySs + 1
end if
mySs = GetVar("accounts\Shops\" & getTile2 & ".ini", "shop", "slot" & 2)
if mySs = 50 Then
gaySs = gaySs + 1
end if
mySs = GetVar("accounts\Shops\" & getTile2 & ".ini", "shop", "slot" & 3)
if mySs = 50 Then
gaySs = gaySs + 1
end if
mySs = GetVar("accounts\Shops\" & getTile2 & ".ini", "shop", "slot" & 4)
if mySs = 50 Then
gaySs = gaySs + 1
end if
mySs = GetVar("accounts\Shops\" & getTile2 & ".ini", "shop", "slot" & 5)
if mySs = 50 Then
gaySs = gaySs + 1
end if
mySs = GetVar("accounts\Shops\" & getTile2 & ".ini", "shop", "slot" & 6)
if mySs = 50 Then
gaySs = gaySs + 1
end if
mySs = GetVar("accounts\Shops\" & getTile2 & ".ini", "shop", "slot" & 7)
if mySs = 50 Then
gaySs = gaySs + 1
end if
mySs = GetVar("accounts\Shops\" & getTile2 & ".ini", "shop", "slot" & 8)
if mySs = 50 Then
gaySs = gaySs + 1
end if
mySs = GetVar("accounts\Shops\" & getTile2 & ".ini", "shop", "slot" & 9)
if mySs = 50 Then
gaySs = gaySs + 1
end if
mySs = GetVar("accounts\Shops\" & getTile2 & ".ini", "shop", "slot" & 10)
if mySs = 50 Then
gaySs = gaySs + 1
end if
mySs = GetVar("accounts\Shops\" & getTile2 & ".ini", "shop", "slot" & 11)
if mySs = 50 Then
gaySs = gaySs + 1
end if
mySs = GetVar("accounts\Shops\" & getTile2 & ".ini", "shop", "slot" & 12)
if mySs = 50 Then
gaySs = gaySs + 1
end if
mySs = GetVar("accounts\Shops\" & getTile2 & ".ini", "shop", "slot" & 13)
if mySs = 50 Then
gaySs = gaySs + 1
end if
mySs = GetVar("accounts\Shops\" & getTile2 & ".ini", "shop", "slot" & 14)
if mySs = 50 Then
gaySs = gaySs + 1
end if
mySs = GetVar("accounts\Shops\" & getTile2 & ".ini", "shop", "slot" & 15)
if mySs = 50 Then
gaySs = gaySs + 1
end if
mySs = GetVar("accounts\Shops\" & getTile2 & ".ini", "shop", "slot" & 16)
if mySs = 50 Then
gaySs = gaySs + 1
end if
mySs = GetVar("accounts\Shops\" & getTile2 & ".ini", "shop", "slot" & 17)
if mySs = 50 Then
gaySs = gaySs + 1
end if
mySs = GetVar("accounts\Shops\" & getTile2 & ".ini", "shop", "slot" & 18)
if mySs = 50 Then
gaySs = gaySs + 1
end if
mySs = GetVar("accounts\Shops\" & getTile2 & ".ini", "shop", "slot" & 19)
if mySs = 50 Then
gaySs = gaySs + 1
end if
mySs = GetVar("accounts\Shops\" & getTile2 & ".ini", "shop", "slot" & 20)
if mySs = 50 Then
gaySs = gaySs + 1
end if
mySs = GetVar("accounts\Shops\" & getTile2 & ".ini", "shop", "slot" & 21)
if mySs = 50 Then
gaySs = gaySs + 1
end if
mySs = GetVar("accounts\Shops\" & getTile2 & ".ini", "shop", "slot" & 22)
if mySs = 50 Then
gaySs = gaySs + 1
end if
mySs = GetVar("accounts\Shops\" & getTile2 & ".ini", "shop", "slot" & 23)
if mySs = 50 Then
gaySs = gaySs + 1
end if
mySs = GetVar("accounts\Shops\" & getTile2 & ".ini", "shop", "slot" & 24)
if mySs = 50 Then
gaySs = gaySs + 1
end if
mySs = GetVar("accounts\Shops\" & getTile2 & ".ini", "shop", "slot" & 25)
if mySs = 50 Then
gaySs = gaySs + 1
end if

if gaySs = 25 Then
Call PlayerMsg(index, "Done closing shop.", 12)
Call PutVar("accounts\Shops\" & getTile2 & ".ini", "shop", "running", 0)
Call PutVar("accounts\Shops\" & "setup.ini", "setup", GetPlayerX(index) & GetPlayerY(index) & GetPlayerMap(index) & "Taken", 0)
Call PutVar("accounts\Shops\" & "setup.ini", "setup", GetPlayerX(index) & GetPlayerY(index) & GetPlayerMap(index) & "name", "none")
Call PutVar("accounts\Shops\" & getTile2 & ".ini", "shop", "running", 0)

Call PutVar("accounts\Shops\" & getTile2 & ".ini", "shop", "desc", "NONE")

    Do While c <= 24
Call PutVar("accounts\Shops\" & getTile2 & ".ini", "shop", "slot" & c, 0)     
        C = C + 1
    Loop

              C = 1
    Do While c <= 25
Call PutVar("accounts\Shops\" & getTile2 & ".ini", "shop", "slot" & c, 50)
Call PutVar("accounts\Shops\" & getTile2 & ".ini", "shop", "slotvalue" & c, 0)
Call PutVar("accounts\Shops\" & getTile2 & ".ini", "shop", "slotprice" & c, 0)   
        C = C + 1
    Loop

else

call playermsg(Index, "The shop has some items in it.", 12)

end if

end if
end if

exit sub

case "/editmyshop"

Call CustomMenuShow(index, "shop2", "\GUI\CUSTOM\playershop.bmp", 1)
Call CustomMenuLabel(index, 1, "Please input item # you want to sell:", 69, 21, 8, 2, 0, 400, 20)
                                                  call CustomMenuTextBox(Index, 1, 250, 35, 59, "")

Call CustomMenuLabel(index, 2, "Player Shops made by FAISAL (MYSRO)", 21,408, 8, 3, 0, 320, 320)

exit sub

case "/price"
iNum = TextSay(1) 

iPrice = TextSay(2)
if iNum < 0 then
call playermsg(index, "Can't find item.", 12)
exit sub
end if
if iPrice >= 2000000000 Then
Call PlayerMsg(Index, "Error: Max price is 2000000000", 12)
exit sub
end if
if iPrice <= 0 Then
Call PlayerMsg(index, "Can not price the item 0 or lower.", 12)
exit sub                                                     
end if
if iNum >= 25 Then
call playermsg(Index, "Doesn't even exist.", 12)
exit sub
end if
shopismade = GetVar("accounts\Shops\" & GetPlayerName(index) & ".ini", "shop", "ismade")
if shopismade = 1 Then
call playermsg(Index, "Shop exists.", 12)
itemExist = GetVar("accounts\Shops\" & GetPlayerName(index) & ".ini", "shop", "slot" & iNum)
'call playermsg(index, iPrice, 12)
If itemExist = 0 Then
call playermsg(Index, "The item # you have entered doesn't exist.", 12)
exit sub
else
Call PutVar("accounts\Shops\" & GetPlayerName(index) & ".ini", "shop", "slotprice" & iNum, "" & iPrice)
Call PlayerMsg(index, "Priced: " & getitemname(itemExist) & " as " & iPrice & " Gold!", 12)
end if
else
call playermsg(index, "Sorry you need a shop!", 12)
end if
exit sub     

case "/shopdesc"
desc2 = TextSay(1)
shopismade = GetVar("accounts\Shops\" & GetPlayerName(index) & ".ini", "shop", "ismade")
        if shopismade = 0 then
        call playermsg(Index, "You need a shop!", 12)
        exit sub
        end if
Call PutVar("accounts\Shops\" & GetPlayerName(index) & ".ini", "shop", "desc", "" & desc2)
Call PlayerMsg(Index, "Added description as: " & desc2 & ".", 12)
Call PlayerMsg(Index, "Make-sure-you-added-the-description-like-this-or-it-wont work.", 12)
exit sub

Case "/warpto"
If GetPlayerAccess(Index) > 0 Then
MapNum = TextSay(1)

If MapNum > 0 And MapNum <= MAX_MAPS Then
Call PlayerWarp(Index, MapNum, GetPlayerX(Index), GetPlayerY(Index))
Call PlayerMsg(Index, "You have been warped to map #" & MapNum & ".", BRIGHTBLUE)
Else
Call PlayerMsg(Index, "Invalid map number.", BRIGHTRED)
End If
End If
Exit Sub
End Select

Call PlayerMsg(Index, "That is not a valid command.", BRIGHTRED)
End Sub

' Executes on death, dropping all of the players items.
Sub DropItems(Index)
' Remove this to enable.
Exit Sub

If GetPlayerWeaponSlot(Index) > 0 Then
    Call PlayerMapDropItem(Index, GetPlayerWeaponSlot(Index), 0)
End If

If GetPlayerArmorSlot(Index) > 0 Then
    Call PlayerMapDropItem(Index, GetPlayerArmorSlot(Index), 0)
End If

If GetPlayerHelmetSlot(Index) > 0 Then
    Call PlayerMapDropItem(Index, GetPlayerHelmetSlot(Index), 0)
End If

If GetPlayerShieldSlot(Index) > 0 Then
    Call PlayerMapDropItem(Index, GetPlayerShieldSlot(Index), 0)
End If

If GetPlayerLegsSlot(Index) > 0 Then
    Call PlayerMapDropItem(Index, GetPlayerLegsSlot(Index), 0)
End If

If GetPlayerRingSlot(Index) > 0 Then
    Call PlayerMapDropItem(Index, GetPlayerRingSlot(Index), 0)
End If

If GetPlayerNecklaceSlot(Index) > 0 Then
    Call PlayerMapDropItem(Index, GetPlayerNecklaceSlot(Index), 0)
End If
End Sub
Link to comment
Share on other sites

Hmm…found no errors. Interesting, the Sadscript editor found nothing, but there's a quite blatant one.

Call LoadInternet( Index, i haz rik rollz/lol/")

That line, due to the word filter, would mess up your main.txt. Weird how the editor didn't find it. Oh well. ScriptErrors=1 in the server seems to work much better.
Link to comment
Share on other sites

@Derek.:

> Turning "ScriptErrors" on didn't really do anything except make a bunch of pop-ups come up… I don't really know what that does.

The popups say what the errors are, and where in the main.txt they are.

Either way, go down your script and change all instances of:
```
i haz rik rollz/lol/"
```to:
```
"http://www.youtube.com/watch?v=oHg5SJYRHA0"
```(make sure you include quotes)

Sadscript is very easy, just take some time to read afew tutorials; I'd recommend these two set (have notepad open the whole time ;)):
http://www.touchofdeathforums.com/smf/index.php/topic,40682.0.html
http://www.touchofdeathforums.com/smf/index.php/topic,40746.0.html

http://www.touchofdeathforums.com/smf/index.php/topic,39867.0.html
http://www.touchofdeathforums.com/smf/index.php/topic,42156.0.html

Then check out Godlord's tutorials.  This stuff will end up being second nature ;)
Link to comment
Share on other sites

@Derek.:

> What I'm confused about, is that I can't find i haz rik rollz/lol/" anywhere in the script.

I might not have typed that exactly. I deleted it out of the main.txt you sent me before I posted this. Might be different spelling. I know that the "/lol/" part was there, though. Let me find the exact text.

> i has rik rollz/lol/"

My bad, it was "has", not "haz".
Link to comment
Share on other sites

Maybe I'm a little lost. I don't have that line in my main.txt. I know what you're talking about, but if you look at the example above, I don't have it in there. And I don't know where I'd put it. This: doesn't work:

Case "/RollRick"
  color = Rand(0, 15)
        Call PlayerMsg(Index, "We're no strangers to love", color)
  color = Rand(0, 15)
        Call PlayerMsg(Index, "You know the rules and so do I", color)
  color = Rand(0, 15)
        Call PlayerMsg(Index, "A full commitment's what I'm thinking of", color)
  color = Rand(0, 15)
        Call PlayerMsg(Index, "You wouldn't get this from any other guy", color)
  color = Rand(0, 15)
        Call PlayerMsg(Index, " ", $color)
        Call PlayerMsg(Index, "I just wanna tell you how I'm feeling", color)
  color = Rand(0, 15)
        Call PlayerMsg(Index, "Gotta make you understand", color)
  color = Rand(0, 15)
        Call PlayerMsg(Index, " ", color)
        Call PlayerMsg(Index, "Never gonna give you up, never gonna let you down", color)
  color = Rand(0, 15)
        Call PlayerMsg(Index, "Never gonna run around and desert you", color)
  color = Rand(0, 15)
        Call PlayerMsg(Index, "Never gonna make you cry, never gonna say goodbye", color)
  color = Rand(0, 15)
        Call PlayerMsg(Index, "Never gonna tell a lie and hurt you", color)
  color = Rand(0, 15)
        Call PlayerMsg(Index, " ", color)
        Call PlayerMsg(Index, "We've known each other for so long", WHITE)
  color = Rand(0, 15)
        Call PlayerMsg(Index, "Your heart's been aching but you're too shy to say it", color)
  color = Rand(0, 15)
        Call PlayerMsg(Index, "Inside we both know what's been going on", color)
  color = Rand(0, 15)
        Call PlayerMsg(Index, "We know the game and we're gonna play it", color)
  color = Rand(0, 15)
        Call PlayerMsg(Index, " ", color)
        Call PlayerMsg(Index, "And if you ask me how I'm feeling", color)
  color = Rand(0, 15)
        Call PlayerMsg(Index, "Don't tell me you're too blind to see", color)
  color = Rand(0, 15)
        Call PlayerMsg(Index, "", color)
        Call PlayerMsg(Index, "Never gonna give you up, never gonna let you down", color)
  color = Rand(0, 15)
        Call PlayerMsg(Index, "Never gonna run around and desert you", color)
  color = Rand(0, 15)
        Call PlayerMsg(Index, "Never gonna make you cry, never gonna say goodbye", color)
  color = Rand(0, 15)
        Call PlayerMsg(Index, "Never gonna tell a lie and hurt you", color)
      Exit Sub

      Case "/RollRick"
        Call LoadInternet("http://www.youtube.com/watch?v=oHg5SJYRHA0")
      Exit Sub
Link to comment
Share on other sites

```
gaySs = 0
'HUGE SCRIPT ALERT
mySs = GetVar("accounts\Shops\" & getTile2 & ".ini", "shop", "slot" & 1)
if mySs = 50 Then
gaySs = gaySs + 1
end if
mySs = GetVar("accounts\Shops\" & getTile2 & ".ini", "shop", "slot" & 2)
if mySs = 50 Then
gaySs = gaySs + 1
end if
mySs = GetVar("accounts\Shops\" & getTile2 & ".ini", "shop", "slot" & 3)
if mySs = 50 Then
gaySs = gaySs + 1
end if
mySs = GetVar("accounts\Shops\" & getTile2 & ".ini", "shop", "slot" & 4)
if mySs = 50 Then
gaySs = gaySs + 1
end if
mySs = GetVar("accounts\Shops\" & getTile2 & ".ini", "shop", "slot" & 5)
if mySs = 50 Then
gaySs = gaySs + 1
end if
mySs = GetVar("accounts\Shops\" & getTile2 & ".ini", "shop", "slot" & 6)
if mySs = 50 Then
gaySs = gaySs + 1
end if
mySs = GetVar("accounts\Shops\" & getTile2 & ".ini", "shop", "slot" & 7)
if mySs = 50 Then
gaySs = gaySs + 1
end if
mySs = GetVar("accounts\Shops\" & getTile2 & ".ini", "shop", "slot" & 8)
if mySs = 50 Then
gaySs = gaySs + 1
end if
mySs = GetVar("accounts\Shops\" & getTile2 & ".ini", "shop", "slot" & 9)
if mySs = 50 Then
gaySs = gaySs + 1
end if
mySs = GetVar("accounts\Shops\" & getTile2 & ".ini", "shop", "slot" & 10)
if mySs = 50 Then
gaySs = gaySs + 1
end if
mySs = GetVar("accounts\Shops\" & getTile2 & ".ini", "shop", "slot" & 11)
if mySs = 50 Then
gaySs = gaySs + 1
end if
mySs = GetVar("accounts\Shops\" & getTile2 & ".ini", "shop", "slot" & 12)
if mySs = 50 Then
gaySs = gaySs + 1
end if
mySs = GetVar("accounts\Shops\" & getTile2 & ".ini", "shop", "slot" & 13)
if mySs = 50 Then
gaySs = gaySs + 1
end if
mySs = GetVar("accounts\Shops\" & getTile2 & ".ini", "shop", "slot" & 14)
if mySs = 50 Then
gaySs = gaySs + 1
end if
mySs = GetVar("accounts\Shops\" & getTile2 & ".ini", "shop", "slot" & 15)
if mySs = 50 Then
gaySs = gaySs + 1
end if
mySs = GetVar("accounts\Shops\" & getTile2 & ".ini", "shop", "slot" & 16)
if mySs = 50 Then
gaySs = gaySs + 1
end if
mySs = GetVar("accounts\Shops\" & getTile2 & ".ini", "shop", "slot" & 17)
if mySs = 50 Then
gaySs = gaySs + 1
end if
mySs = GetVar("accounts\Shops\" & getTile2 & ".ini", "shop", "slot" & 18)
if mySs = 50 Then
gaySs = gaySs + 1
end if
mySs = GetVar("accounts\Shops\" & getTile2 & ".ini", "shop", "slot" & 19)
if mySs = 50 Then
gaySs = gaySs + 1
end if
mySs = GetVar("accounts\Shops\" & getTile2 & ".ini", "shop", "slot" & 20)
if mySs = 50 Then
gaySs = gaySs + 1
end if
mySs = GetVar("accounts\Shops\" & getTile2 & ".ini", "shop", "slot" & 21)
if mySs = 50 Then
gaySs = gaySs + 1
end if
mySs = GetVar("accounts\Shops\" & getTile2 & ".ini", "shop", "slot" & 22)
if mySs = 50 Then
gaySs = gaySs + 1
end if
mySs = GetVar("accounts\Shops\" & getTile2 & ".ini", "shop", "slot" & 23)
if mySs = 50 Then
gaySs = gaySs + 1
end if
mySs = GetVar("accounts\Shops\" & getTile2 & ".ini", "shop", "slot" & 24)
if mySs = 50 Then
gaySs = gaySs + 1
end if
mySs = GetVar("accounts\Shops\" & getTile2 & ".ini", "shop", "slot" & 25)
if mySs = 50 Then
gaySs = gaySs + 1
end if
```Eh right…

```
For Slot = 1 To 25
If GetVar("Accounts\Shops\" & getTile2 & ".ini", "Shop", "Slot" & Slot) <> vbNullString And CInt(GetVar("Accounts\Shops\" & getTile2 & ".ini", "Shop", "Slot" & Slot)) = 50 Then
Count = Count + 1
End If
Next
```
```
  color = Rand(0, 15)
        Call PlayerMsg(Index, "We're no strangers to love", color)
  color = Rand(0, 15)
        Call PlayerMsg(Index, "You know the rules and so do I", color)
  color = Rand(0, 15)
        Call PlayerMsg(Index, "A full commitment's what I'm thinking of", color)
  color = Rand(0, 15)
        Call PlayerMsg(Index, "You wouldn't get this from any other guy", color)
  color = Rand(0, 15)
        Call PlayerMsg(Index, " ", $color)
        Call PlayerMsg(Index, "I just wanna tell you how I'm feeling", color)
  color = Rand(0, 15)
        Call PlayerMsg(Index, "Gotta make you understand", color)
  color = Rand(0, 15)
        Call PlayerMsg(Index, " ", color)
        Call PlayerMsg(Index, "Never gonna give you up, never gonna let you down", color)
  color = Rand(0, 15)
        Call PlayerMsg(Index, "Never gonna run around and desert you", color)
  color = Rand(0, 15)
        Call PlayerMsg(Index, "Never gonna make you cry, never gonna say goodbye", color)
  color = Rand(0, 15)
        Call PlayerMsg(Index, "Never gonna tell a lie and hurt you", color)
  color = Rand(0, 15)
        Call PlayerMsg(Index, " ", color)
        Call PlayerMsg(Index, "We've known each other for so long", WHITE)
  color = Rand(0, 15)
        Call PlayerMsg(Index, "Your heart's been aching but you're too shy to say it", color)
  color = Rand(0, 15)
        Call PlayerMsg(Index, "Inside we both know what's been going on", color)
  color = Rand(0, 15)
        Call PlayerMsg(Index, "We know the game and we're gonna play it", color)
  color = Rand(0, 15)
        Call PlayerMsg(Index, " ", color)
        Call PlayerMsg(Index, "And if you ask me how I'm feeling", color)
  color = Rand(0, 15)
        Call PlayerMsg(Index, "Don't tell me you're too blind to see", color)
  color = Rand(0, 15)
        Call PlayerMsg(Index, "", color)
        Call PlayerMsg(Index, "Never gonna give you up, never gonna let you down", color)
  color = Rand(0, 15)
        Call PlayerMsg(Index, "Never gonna run around and desert you", color)
  color = Rand(0, 15)
        Call PlayerMsg(Index, "Never gonna make you cry, never gonna say goodbye", color)
  color = Rand(0, 15)
        Call PlayerMsg(Index, "Never gonna tell a lie and hurt you", color)
              Exit Sub
```:huh:

```
Dim TextIndex

TextIndex = 1

Do While GetVar("RollRick.ini", "Lyrics", "Rule" & TextIndex) <> vbNullString
Color = Rand(0, 15)
Call PlayerMsg(Index, GetVar("RollRick.ini", "Lyrics", "Rule" & TextIndex), Color)
TextIndex = TextIndex + 1
Loop

Exit Sub
```
I'm not even dealing with the rest, please learn Sadscript before making something huge like this.

@Balliztik1:

> Hmm…found no errors. Interesting, the Sadscript editor found nothing, but there's a quite blatant one.
>
> Call LoadInternet( Index, i haz rik rollz/lol/")
>
> That line, due to the word filter, would mess up your main.txt. Weird how the editor didn't find it. Oh well. ScriptErrors=1 in the server seems to work much better.

That's why I don't use the Sadscript Editor.

Regards,
  Godlord.
Link to comment
Share on other sites

W8 a minute, where is color defined ANYWHERE!!!!! shouldn't it be dimmed at the top, so, like this:
```

' Executed whenever a slash command is sent to the server.
Sub Commands(Index)
  Dim TextSay
  Dim PlayerID
  Dim MapNum
  Dim color

```I just want to point out the Dim color, otherwise it should go at the very beginning of the rolled rick slash command (or you could set color = Rand(1,15) at the very beginning of the slash commands sub!?! But, cmon, no one noticed the lack of dimming?
Link to comment
Share on other sites

can i point out in godlords code, to you Diskmaster,
this:

> # Dim TextIndex 
>  
> TextIndex = 1 
>  
> Do While GetVar("RollRick.ini", "Lyrics", "Rule" & TextIndex) <> vbNullString 
>     **Color = Rand(0, 15)** 
>     Call PlayerMsg(Index, GetVar("RollRick.ini", "Lyrics", "Rule" & TextIndex), Color) 
>     TextIndex = TextIndex + 1 
> Loop 
>  
> Exit Sub

its defined…
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...