| Blockland Forums > Modification Help |
| My chatbot is not working |
| << < (15/23) > >> |
| Deoxys And One Noob:
--- Quote from: jes00 on April 04, 2012, 02:25:52 PM ---Much better :P --- Code: ---// Made by ThinkInvisible, BLID 14511, helped and edited by Deoxys & One Noob, BLID 30436 package GunGame { $rouletteBarrel = getRandom(1, 7); $rouletteScoreCombo = 0; $rouletteLastShoot = Nan; function clientCmdChatMessage(%a,%b,%c,%fmsg,%cp,%name,%cs,%msg) { parent::clientCmdChatMessage(%a,%b,%c,%fmsg,%cp,%name,%cs,%msg); if(strPos(%msg,"Roulette") > 0 && (strPos(%msg,"Dare the odds") > 0)) { if($rouletteLastShoot != %name) { commandToServer('messageSent', %name SPC "spins the barrel and pulls the trigger..."); %tempVal = getRandom(1, 7); if(%tempVal = $rouletteBarrel) { $rouletteScore[%name] ++; export("$rouletteScore*","config/Roulette/scores.cs"); $rouletteLastShoot = Nan; $rouletteBarrel = getRandom(1, 7); commandToServer('messageSent',"NoobBot: *BLAM*..." SPC %name SPC "got hit!" SPC %name SPC "has been hit" SPC $rouletteScore[%name] SPC "times."); } else { commandToServer('messageSent',"NoobBot: *Chk*..." SPC %name SPC "missed the bullet! Nice one there, winner..."); $rouletteLastShoot = %name; } } else { commandToServer('messageSent',"NoobBot: What?" SPC %name @ ", you can't dare your odds twice in a row! Let somebody else have a turn please, for the sake of fun."); } } } }; activatePackage(GunGame); --- End code --- --- End quote --- Whats the SPC for? I still have syntax errors |
| jes00:
--- Quote from: Deoxys And One Noob on April 05, 2012, 05:13:56 PM ---Whats the SPC for? I still have syntax errors --- End quote --- @ = connector. SPC = connector with a space. TAB = connector with a tab. I did not check it for errors. EDIT: Found an error, --- Code: ---if(%tempVal = $rouletteBarrel) --- End code --- must be --- Code: ---if(%tempVal == $rouletteBarrel) --- End code --- |
| Headcrab Zombie:
--- Quote from: jes00 on April 05, 2012, 05:17:00 PM ---connector --- End quote --- The proper term is concatenator --- Quote from: jes00 on April 05, 2012, 05:17:00 PM ---EDIT: Found an error, --- Code: ---if(%tempVal = $rouletteBarrel) --- End code --- must be --- Code: ---if(%tempVal == $rouletteBarrel) --- End code --- --- End quote --- While it is an error, it's a logic error, not a syntax error. Deoxys, just look in the console, it tells you (almost) exactly where the error is, look at that and see if you can practice fixing it yourself, if you can't figure it out that copy and paste it here, instead of making everyone either look through the entire code for it, or run it and look at the console themself. |
| Deoxys And One Noob:
OK, I'm making a chatbot from scratch... Is there such thing as %server? Like this, "NoobBot: Welcome to (servernamehere), (namegoeshere)!" |
| jes00:
--- Quote from: Deoxys And One Noob on April 07, 2012, 05:48:27 PM ---OK, I'm making a chatbot from scratch... Is there such thing as %server? Like this, "NoobBot: Welcome to (servernamehere), (namegoeshere)!" --- End quote --- Use $ServerInfo::Name to get the server name and I'm not helping you to make an auto greeter. |
| Navigation |
| Message Index |
| Next page |
| Previous page |