SHARE
TWEET

Bot.hs

a guest Dec 2nd, 2013 16 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. module Bot where
  2.         --import qualified Socket
  3.         import qualified IA
  4.         import qualified Commands
  5.         type UserName = String
  6.         type UserPass = String
  7.        
  8.         main :: IO()
  9.         main = do
  10.                 usN <- getLine
  11.                 usP <- getLine
  12.                 let goodLogin = loginUser usN usP
  13.                 -- En vez de mostrar por pantalla loopBot, desplazarlo como main principal
  14.                 if goodLogin == False then (putStrLn badLogin) else (putStrLn loopBot)
  15.                 return()
  16.        
  17.         loopBot :: String
  18.         loopBot = "En espera de funcionar"
  19.         --loopBot :: esperando leer del socket,
  20.         --                      una vez lea del socket que haga la funciĆ³n
  21.         --                      gestionar funciones e ir aƱadiendo...
  22.        
  23.        
  24.         badLogin :: String
  25.         badLogin = "Fail credentials"
  26.        
  27.         loginUser :: UserName -> UserPass -> Bool
  28.         loginUser usN usP
  29.                                 | usN == "YourUser" && usP == "YourPass" = True
  30.                                 | otherwise = False
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top