SRL Archive - RS3 Outdated / Broken Scripts

hangman Rs script Help


g0tp0t

2010-06-27 14:19:40

I couldnt find a scar srl runescape script help forum so this is the closest i found -.-

script help -.-. lol

I am trying to make a script that will let people play hangman in runescape. It is only partially finished but im getting typemismatch error…

Here is my code:

{.include srl/srl.scar}
var abc,textt:string;textarray:tstringarray;i,ii:integer;
function getchatarray:array of string;
begin
result := chatboxtextarray(16711680)
end;


Function ConverttoUS(text: string):string; //goes through a given string and replaces all allphabetic charicters with underscores
begin
abc := 'qwertyuiopasdfghjklzxcvbnm';
textt := text
for ii := 1 to 25 do
begin
addtoreport('II: '+inttostr(ii));
for i := 1 to length(text)-1 do
begin
addtoreport('I: '+inttostr(i));
if strget(text,i) = strget(abc,ii) then
textt := Replace(textt,strget(abc,ii),'_');
end
end;
result := textt;
end;

function RandomWordlist :array of string; //<-feature rsonly not yet added
var therandnum:integer;theresult:string;
begin
TextArray := ['Runescape Owns',
'Jagex',
'Skill Cape',
'Attack',
'Strength',
'Defence',
'Renged',
'Prayer',
'Magic',
'Runecrafting',
'Dungeoneering',
'Constiution',
'Crafting',
'Mining',
'Smithin',
'Fishing',
'cooking',
'Firemaking',
'Woodcutting',


{ 'Construction',
'Agility',
'Herblore',
'Thieving',
'Fletching',
'Slayer',
'Hunter',
'Farming',
'Summoning',
}

'The Blood Pact',
'Cooks Assistant',
'Demon Slayer',
'Dorics Quest',
'Ernest the Chicken',
'Goblin Diplomacy',
'Imp Catcher',
'Myths of the White Lands',
'Pirates treasure',
'Prince Ali Rescue',
'The Restless Ghost',
'Romeo and Juliet',
'Rune Mysteries',
'Sheild of Arrav',
'Swept Away',
'Unstable Foundations',
'Vampire Slayer',
'Cadava Berries',
'Rune Armour Set',
'Rune Full Helm',
'Rune Kite Shield',
'Rune Platebody',
'Rune Platelegs',
'Rune Boots',
'Runite Ore',
'Adamant Armour Set',
'Adamant Full Helm',
'Adamant Kite Shield',
'Adamant Platebody',
'Adamant Platelegs',
'Adamant Boots',
'Adamantite Ore',
'Mithril Armour Set',
'Mithril Full Helm',
'Mithril Kite Shield',
'Mithril Platebody',
'Mithril Platelegs',
'Mithril Boots',
'Mithril Ore',
'Black Armour Set',
'Black Full Helm',
'Black Kite Shield',
'Black Platebody',
'Black Platelegs',
'Black Boots',
'White Full Helm',
'White Kite Shield',
'White Platebody',
'White Platelegs',
'White Boots',
'Steel Armour Set',
'Steel Full Helm',
'Steel Kite Shield',
'Steel Platebody',
'Steel Platelegs',
'Steel Boots',
'Iron Armour Set',
'Iron Full Helm',
'Iron Kite Shield',
'Iron Platebody',
'Iron Platelegs',
'Iron Boots',
'Iron Ore',
'Bronze Armour Set',
'Bronze Full Helm',
'Bronze Kite Shield',
'Bronze Platebody',
'Bronze Platelegs',
'Bronze Boots',
'Bronze Ore',
'Tin Ore',
'Copper Ore',
'Clay',
'Soft Clay',
'Dragon Platelegs',
'Dragon Pleatbody',
'Dragon Battelaxe',
'Dragon 2H',
'Dragon Chainbody',
'Corporeal Beast',
'Steel Dragon',
'Mithril Dragon',
'Bronze Dragon,',
'Blue Dragon',
'Happy Dragon',
'Sad Dragon',
'Your mother',
'Tuna',
'Cod',
'Salmon',
'Trout',
'Logs',
'Willow Logs',
'Yew Logs',
//'Magic Logs',,
'Elvarg',
'Mod Mark',
'Coins',
'Air Guitar Emote',
'Rasberry Emote',
'Wind Strike',
'Earth Strike',
'Water Strike',
'Fire Strike',
'Wind Bolt',
'Earth Bolt',
'Water Bolt',
'Fire Bolt',
'Wind Blast',
'Earth Blast',
'Water Blast',
'Fire Blast',
'Wind Wave',
'Earth Wave',
'Water Wave',
'Fire wave',
'Wind Surge',
'Earth Surge',
'Water Surge',
'Fire Surge'
{
'Miasmic Barrage',
'Shadow Blitz',
'Smoke Blitz',
'Blood Blitz',
'Ice blitz',
'Smoke Rush',
'Shadow Rush',
'Blood rush',
'Ice Rush',
}
]
therandnum := random(getarraylength(textarray))
theresult := [(ConvertToUS(textarray[therandnum])), textarray[therandnum]]
result := theresult
end;

begin
typesendex(randomwordlist,false)
end.

any glaring errors?? lol the error returned is:

Failed when compiling
Line 195: [Error] (21286:1): Type mismatch in script

Rich

2010-06-27 14:28:02

What's the line giving the error?

EDIT:
theresult := [(ConvertToUS(textarray[therandnum])), textarray[therandnum]

In the function 'ConvertToUS' you've only got one parameter, but you're using two ^. Also you've got the above line in [] brackets which are used for arrays, and since 'theresult' isn't an array, would give a type mismatch error.

g0tp0t

2010-06-27 14:28:35

195 :]

g0tp0t

2010-06-27 14:39:41

lol. if i change the type to array then i get an error wich doesnt give me a line number

that is why i kept as string -,-

EDIT: cant delete double post -.-

ffcfoo

2010-07-01 14:57:30

This is the wrong section to ask in. Go here: http://villavu.com/forum/forumdisplay.php?f=184

g0tp0t

2010-07-07 14:52:18

noone sees anything wrong?